hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70b00541c568010e818a7b67bc34d90385cc984 | 148 | py | Python | tasks.py | mtkennerly/clingy | 39454bcf535127ee80ca3e9fb1580dfefcb8aad9 | [
"MIT"
] | 1 | 2017-03-24T09:19:18.000Z | 2017-03-24T09:19:18.000Z | tasks.py | mtkennerly/clingy | 39454bcf535127ee80ca3e9fb1580dfefcb8aad9 | [
"MIT"
] | null | null | null | tasks.py | mtkennerly/clingy | 39454bcf535127ee80ca3e9fb1580dfefcb8aad9 | [
"MIT"
] | null | null | null | from invoke import task
@task
def dist(context):
context.run("python setup.py bdist_wheel")
@task
def test(context):
context.run("tox")
| 12.333333 | 46 | 0.695946 | from invoke import task
@task
def dist(context):
context.run("python setup.py bdist_wheel")
@task
def test(context):
context.run("tox")
| true | true |
f70b0072f7dbff073d399e1d6359799fc8a20bd0 | 23,970 | py | Python | cmake/external/tvm/python/tvm/relay/op/nn/nn.py | fushwLZU/onnxruntime_test | 7ee82dde9150dc0d3014c06a82eabdecb989f2f3 | [
"MIT"
] | 2 | 2020-06-24T03:16:34.000Z | 2020-06-24T03:16:36.000Z | cmake/external/tvm/python/tvm/relay/op/nn/nn.py | fushwLZU/onnxruntime_test | 7ee82dde9150dc0d3014c06a82eabdecb989f2f3 | [
"MIT"
] | 4 | 2020-12-04T21:00:38.000Z | 2022-01-22T12:49:30.000Z | cmake/external/tvm/python/tvm/relay/op/nn/nn.py | fushwLZU/onnxruntime_test | 7ee82dde9150dc0d3014c06a82eabdecb989f2f3 | [
"MIT"
] | 1 | 2019-09-20T07:05:27.000Z | 2019-09-20T07:05:27.000Z | """Neural network operations."""
from __future__ import absolute_import as _abs
from ...expr import TupleWrapper
from . import _make
def conv2d(data,
weight,
strides=(1, 1),
padding=(0, 0),
dilation=(1, 1),
groups=1,
channels=None,
kernel_si... | 27.839721 | 93 | 0.591197 | from __future__ import absolute_import as _abs
from ...expr import TupleWrapper
from . import _make
def conv2d(data,
weight,
strides=(1, 1),
padding=(0, 0),
dilation=(1, 1),
groups=1,
channels=None,
kernel_size=None,
data_layout="... | true | true |
f70b00d468378a77011e80dc65f27686941deebd | 820 | py | Python | tests/test_parser_leaf_html.py | sthagen/python-artichoke_growth | 4d96d8bf63234248352dd10a3fb99c35d8312661 | [
"MIT"
] | 1 | 2020-07-16T17:29:06.000Z | 2020-07-16T17:29:06.000Z | tests/test_parser_leaf_html.py | sthagen/python-artichoke_growth | 4d96d8bf63234248352dd10a3fb99c35d8312661 | [
"MIT"
] | 17 | 2020-07-16T17:07:07.000Z | 2020-12-06T16:36:23.000Z | tests/test_parser_leaf_html.py | sthagen/python-artichoke_growth | 4d96d8bf63234248352dd10a3fb99c35d8312661 | [
"MIT"
] | null | null | null | import pathlib
from bs4 import BeautifulSoup
HTML_LEAF_PAGE_SAMPLE_PATH = pathlib.Path('tests', 'fixtures', 'html', 'leaf_page_sample.html')
HTML_TEXT = ''
def setup():
global HTML_TEXT
with open(HTML_LEAF_PAGE_SAMPLE_PATH, "rt", encoding="utf-8") as handle:
HTML_TEXT = handle.read()
def teardown()... | 24.848485 | 95 | 0.590244 | import pathlib
from bs4 import BeautifulSoup
HTML_LEAF_PAGE_SAMPLE_PATH = pathlib.Path('tests', 'fixtures', 'html', 'leaf_page_sample.html')
HTML_TEXT = ''
def setup():
global HTML_TEXT
with open(HTML_LEAF_PAGE_SAMPLE_PATH, "rt", encoding="utf-8") as handle:
HTML_TEXT = handle.read()
def teardown()... | true | true |
f70b0188a275a756a3c5e6d61a896aefc90b9b12 | 835 | py | Python | mysite/polls/models.py | 3ng7n33r/DjangoTutorial | 0885d3d9468292c0bf81f5a5fd508fae2c1a482c | [
"MIT"
] | 40 | 2018-02-06T09:16:18.000Z | 2022-03-27T14:56:24.000Z | mysite/polls/models.py | 3ng7n33r/DjangoTutorial | 0885d3d9468292c0bf81f5a5fd508fae2c1a482c | [
"MIT"
] | 12 | 2019-08-06T01:56:51.000Z | 2022-02-10T09:14:43.000Z | mysite/polls/models.py | 3ng7n33r/DjangoTutorial | 0885d3d9468292c0bf81f5a5fd508fae2c1a482c | [
"MIT"
] | 35 | 2018-06-05T20:27:21.000Z | 2022-02-23T12:05:40.000Z | import datetime
from django.db import models
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
def was_published_recently(self):
... | 28.793103 | 71 | 0.736527 | import datetime
from django.db import models
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
def was_published_recently(self):
... | true | true |
f70b0253d83abf3447aa21eeb56a66eb9cde590c | 10,417 | py | Python | kolb-proust/porcess-cards/makeJSONIntoTTL.py | CIRSS/linked-sp-mockups | 9732ece022628442f77cdeff5093ef106704413b | [
"MIT"
] | 1 | 2018-04-14T00:12:55.000Z | 2018-04-14T00:12:55.000Z | kolb-proust/porcess-cards/makeJSONIntoTTL.py | CIRSS/linked-sp-mockups | 9732ece022628442f77cdeff5093ef106704413b | [
"MIT"
] | null | null | null | kolb-proust/porcess-cards/makeJSONIntoTTL.py | CIRSS/linked-sp-mockups | 9732ece022628442f77cdeff5093ef106704413b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os, json
if os.name == 'nt':
SLASH = '\\'
else:
SLASH = '/'
def makeOutputFolder(folder_name,counter):
try:
if counter is not None:
write_folder_name = folder_name + ' (' + str(counter) + ')'
else:
write_folder_name = folder_name
write_folder = os.mkdir(write_folder_name... | 46.09292 | 141 | 0.622924 | import os, json
if os.name == 'nt':
SLASH = '\\'
else:
SLASH = '/'
def makeOutputFolder(folder_name,counter):
try:
if counter is not None:
write_folder_name = folder_name + ' (' + str(counter) + ')'
else:
write_folder_name = folder_name
write_folder = os.mkdir(write_folder_name)
return write_folder,... | false | true |
f70b035def2ff8729c21add34a0315c29add3dcb | 1,251 | py | Python | PyGame-Tutorials/tut06.py | AnubhavMadhav/PyGames | d35ac2c8140bdae1b2bf2f6dca057b3b461d11c8 | [
"Apache-2.0"
] | 5 | 2020-06-04T11:48:09.000Z | 2020-11-29T08:33:42.000Z | PyGame-Tutorials/tut06.py | AnubhavMadhav/PyGames | d35ac2c8140bdae1b2bf2f6dca057b3b461d11c8 | [
"Apache-2.0"
] | null | null | null | PyGame-Tutorials/tut06.py | AnubhavMadhav/PyGames | d35ac2c8140bdae1b2bf2f6dca057b3b461d11c8 | [
"Apache-2.0"
] | null | null | null | '''
Coding our First Game in PyGame
-
Creating Ground for Snakes
'''
import pygame
pygame.init()
# print(x) # All 6 pygame modules successfully imported
# Colors
white = (255, 255, 255)
red = (255, 0, 0)
black = (0, 0, 0)
# Creating Game Window
screen_width = 900
screen_height = 600
gameWindow = pygame... | 28.431818 | 173 | 0.650679 |
import pygame
pygame.init()
white = (255, 255, 255)
red = (255, 0, 0)
black = (0, 0, 0)
screen_width = 900
screen_height = 600
gameWindow = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption("Snake - by Anubhav Madhav") pygame.display.update() ... | true | true |
f70b03c8718a2d81744520d6a0d9e0abea8b40a2 | 124 | py | Python | Florence/FiniteElements/Assembly/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 65 | 2017-08-04T10:21:13.000Z | 2022-02-21T21:45:09.000Z | Florence/FiniteElements/Assembly/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 6 | 2018-06-03T02:29:20.000Z | 2022-01-18T02:30:22.000Z | Florence/FiniteElements/Assembly/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 10 | 2018-05-30T09:44:10.000Z | 2021-05-18T08:06:51.000Z | from .Assembly import Assemble, AssembleForces, AssembleInternalTractionForces, AssembleExplicit, AssembleMass, AssembleForm | 124 | 124 | 0.887097 | from .Assembly import Assemble, AssembleForces, AssembleInternalTractionForces, AssembleExplicit, AssembleMass, AssembleForm | true | true |
f70b056c1b447b1d1d2392ed2df978ee7b7e61f4 | 7,455 | py | Python | prog/python/python tuto/Pygame-Zero/pacman2/pacman2.py | gribdesbois/prog-backup | a394a392d32c550caf97119456aec1546bc8fbe1 | [
"MIT"
] | null | null | null | prog/python/python tuto/Pygame-Zero/pacman2/pacman2.py | gribdesbois/prog-backup | a394a392d32c550caf97119456aec1546bc8fbe1 | [
"MIT"
] | null | null | null | prog/python/python tuto/Pygame-Zero/pacman2/pacman2.py | gribdesbois/prog-backup | a394a392d32c550caf97119456aec1546bc8fbe1 | [
"MIT"
] | null | null | null | import pgzrun
import gameinput
import gamemaps
from random import randint
from datetime import datetime
WIDTH = 600
HEIGHT = 660
player = Actor("pacman_o") # Load in the player Actor image
player.score = 0
player.lives = 3
level = 0
SPEED = 3
def draw(): # Pygame Zero draw function
global pacDots, player
scre... | 32.272727 | 180 | 0.535882 | import pgzrun
import gameinput
import gamemaps
from random import randint
from datetime import datetime
WIDTH = 600
HEIGHT = 660
player = Actor("pacman_o") player.score = 0
player.lives = 3
level = 0
SPEED = 3
def draw(): global pacDots, player
screen.blit('header', (0, 0))
screen.blit('colourmap', (0, 80... | true | true |
f70b06132039891cd3318917fc783ba4c170086b | 697 | py | Python | examples/example_function_order.py | leandroltavares/pylint-plus | f3ad1a5470f4a99438b39f72a9f4ae690399b08c | [
"MIT"
] | null | null | null | examples/example_function_order.py | leandroltavares/pylint-plus | f3ad1a5470f4a99438b39f72a9f4ae690399b08c | [
"MIT"
] | null | null | null | examples/example_function_order.py | leandroltavares/pylint-plus | f3ad1a5470f4a99438b39f72a9f4ae690399b08c | [
"MIT"
] | null | null | null | #pylint: disable=missing-module-docstring,missing-function-docstring,missing-class-docstring,no-self-use,too-few-public-methods
def first(): # First should be defined after second, too keep call order
pass
def second():
first()
class Example:
def first(self): # First should be defined after second, to... | 23.233333 | 127 | 0.657102 | def first(): pass
def second():
first()
class Example:
def first(self): pass
def second(self):
self.first()
def before(self): self.after()
def after(self):
pass
class ExampleInner:
def outer(self):
def inner(): pass
in... | true | true |
f70b061d2606ca0be36e23f56f65b717929eb470 | 104 | py | Python | calculator/__init__.py | goncalovalverde/seshat | deff5cdd985f81ac2b4ebd077eea11f7c4f4118f | [
"MIT"
] | 1 | 2020-12-22T13:23:00.000Z | 2020-12-22T13:23:00.000Z | calculator/__init__.py | goncalovalverde/seshat | deff5cdd985f81ac2b4ebd077eea11f7c4f4118f | [
"MIT"
] | 5 | 2020-12-22T13:36:30.000Z | 2021-02-27T05:42:18.000Z | calculator/__init__.py | goncalovalverde/seshat | deff5cdd985f81ac2b4ebd077eea11f7c4f4118f | [
"MIT"
] | null | null | null | import logging
class Calculator(object):
def __init__(self, config):
self.config = config
| 14.857143 | 31 | 0.682692 | import logging
class Calculator(object):
def __init__(self, config):
self.config = config
| true | true |
f70b0657a109c516768a303f19153456024b4d50 | 3,686 | py | Python | tests/conftest.py | datdinhquoc/flask_jsondash | 124f5739aebb39c4d36d27a57acb1a32df95a51d | [
"MIT"
] | 3,503 | 2016-08-25T19:57:33.000Z | 2022-03-31T20:04:37.000Z | tests/conftest.py | datdinhquoc/flask_jsondash | 124f5739aebb39c4d36d27a57acb1a32df95a51d | [
"MIT"
] | 203 | 2016-05-06T18:01:12.000Z | 2022-03-23T09:05:28.000Z | tests/conftest.py | datdinhquoc/flask_jsondash | 124f5739aebb39c4d36d27a57acb1a32df95a51d | [
"MIT"
] | 350 | 2016-08-30T10:29:57.000Z | 2022-02-02T17:59:41.000Z | import json
import os
import pytest
from flask import Flask, url_for
from pyquery import PyQuery as pq
from flask_jsondash import charts_builder, utils
from flask_jsondash import db
URL_BASE = 'http://127.0.0.1:80'
app = Flask('test_flask_jsondash',
template_folder='../flask_jsondash/example_app/templat... | 24.091503 | 75 | 0.616658 | import json
import os
import pytest
from flask import Flask, url_for
from pyquery import PyQuery as pq
from flask_jsondash import charts_builder, utils
from flask_jsondash import db
URL_BASE = 'http://127.0.0.1:80'
app = Flask('test_flask_jsondash',
template_folder='../flask_jsondash/example_app/templat... | true | true |
f70b06873d5edf44d17aafe0818fcc3b08d0f79f | 1,866 | py | Python | sam-app-py/tests/unit/test_handler.py | abhinavDhulipala/SAM-URL | 2edaaf11f5baa0153e6ee943635c5d86a55cd84f | [
"MIT"
] | 1 | 2021-04-07T02:44:29.000Z | 2021-04-07T02:44:29.000Z | sam-app-py/tests/unit/test_handler.py | abhinavDhulipala/SAM-URL | 2edaaf11f5baa0153e6ee943635c5d86a55cd84f | [
"MIT"
] | null | null | null | sam-app-py/tests/unit/test_handler.py | abhinavDhulipala/SAM-URL | 2edaaf11f5baa0153e6ee943635c5d86a55cd84f | [
"MIT"
] | null | null | null | import json
import pytest
import os
import sys
abs_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(f'{abs_path}/../..')
sys.path.append(f'{abs_path}/../../..')
print(sys.path[-1])
from moto import mock_dynamodb2
from redirect_handler import app
import boto_utils
from constants import TABLE_NAME
import... | 29.619048 | 117 | 0.595927 | import json
import pytest
import os
import sys
abs_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(f'{abs_path}/../..')
sys.path.append(f'{abs_path}/../../..')
print(sys.path[-1])
from moto import mock_dynamodb2
from redirect_handler import app
import boto_utils
from constants import TABLE_NAME
import... | true | true |
f70b0689e2b44f236e300dba244ccadd6bdde193 | 4,551 | py | Python | test method/tensorflow2.0/deep-sort-yolov4/demo.py | vedanthpadigelwar/AI_projects | 885bbe76800f9a449414b3735ab4a4c4bd2e7aa0 | [
"MIT"
] | null | null | null | test method/tensorflow2.0/deep-sort-yolov4/demo.py | vedanthpadigelwar/AI_projects | 885bbe76800f9a449414b3735ab4a4c4bd2e7aa0 | [
"MIT"
] | null | null | null | test method/tensorflow2.0/deep-sort-yolov4/demo.py | vedanthpadigelwar/AI_projects | 885bbe76800f9a449414b3735ab4a4c4bd2e7aa0 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from timeit import time
import warnings
import cv2
import numpy as np
from PIL import Image
from yolo import YOLO
from deep_sort import preprocessing
from deep_sort import nn_matching
from deep_sort.detect... | 30.34 | 105 | 0.587124 |
from __future__ import division, print_function, absolute_import
from timeit import time
import warnings
import cv2
import numpy as np
from PIL import Image
from yolo import YOLO
from deep_sort import preprocessing
from deep_sort import nn_matching
from deep_sort.detection import Detection
from deep_sort.detection_y... | true | true |
f70b07204b98d80e64ad1e1deb637e4254ae138a | 1,331 | py | Python | var/spack/repos/builtin/packages/py-mypy/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-09-02T08:41:39.000Z | 2020-09-02T08:41:39.000Z | var/spack/repos/builtin/packages/py-mypy/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 25 | 2021-02-08T14:39:48.000Z | 2022-03-21T18:37:29.000Z | var/spack/repos/builtin/packages/py-mypy/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 7 | 2018-09-13T18:04:56.000Z | 2020-03-18T20:52:06.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyMypy(PythonPackage):
"""Optional static typing for Python."""
homepage = "http://ww... | 45.896552 | 97 | 0.730278 |
from spack import *
class PyMypy(PythonPackage):
homepage = "http://www.mypy-lang.org/"
pypi = "mypy/mypy-0.740.tar.gz"
version('0.910', sha256='704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150')
version('0.900', sha256='65c78570329c54fb40f956f7645e2359af5da9d8c54baa44f461cdc7f49841... | true | true |
f70b076d6e55129ea6d8cf88397c36dbdcabc138 | 3,122 | py | Python | superset/models/schedules.py | EikotheRookie/incubator-superset-xzf | 5d167afb9499d7ce30c7ea763b19993af347dc23 | [
"Apache-2.0"
] | 1 | 2020-06-25T14:30:12.000Z | 2020-06-25T14:30:12.000Z | superset/models/schedules.py | EikotheRookie/incubator-superset-xzf | 5d167afb9499d7ce30c7ea763b19993af347dc23 | [
"Apache-2.0"
] | 49 | 2021-06-08T22:27:53.000Z | 2022-03-28T15:59:51.000Z | superset/models/schedules.py | hixio-mh/incubator-superset | 7b7e097325fa8f6f785fe15b83f39e922025022f | [
"Apache-2.0"
] | 2 | 2019-07-19T09:34:24.000Z | 2019-09-20T10:02:04.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.863158 | 85 | 0.744395 | import enum
from typing import Optional, Type
from flask_appbuilder import Model
from sqlalchemy import Boolean, Column, Enum, ForeignKey, Integer, String, Text
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from superset import security_manager
from superset.models.helpe... | true | true |
f70b07933f8381b9d635ee33b267d6a4228698c7 | 3,662 | py | Python | ebay_accounts/trading_api.py | luke-dixon/django-ebay-accounts | 54cf0e90b75dfbdd63bcd588f3c4771ebe1297c0 | [
"BSD-3-Clause"
] | 4 | 2018-01-28T20:10:11.000Z | 2020-09-06T14:30:36.000Z | ebay_accounts/trading_api.py | luke-dixon/django-ebay-accounts | 54cf0e90b75dfbdd63bcd588f3c4771ebe1297c0 | [
"BSD-3-Clause"
] | 7 | 2017-06-04T08:50:06.000Z | 2020-09-06T16:03:53.000Z | ebay_accounts/trading_api.py | luke-dixon/django-ebay-accounts | 54cf0e90b75dfbdd63bcd588f3c4771ebe1297c0 | [
"BSD-3-Clause"
] | 7 | 2017-06-01T09:51:35.000Z | 2021-05-25T16:01:53.000Z | # -*- coding: utf-8 -*-
"""
Ebay Trading API
"""
import xmltodict
import requests
from . import app_settings as settings
class TradingAPIWarning(Exception):
pass
class TradingAPIFailure(Exception):
pass
class TradingAPIInvalidResponse(Exception):
pass
class TradingAPI(object):
_last_response = ... | 35.211538 | 77 | 0.648553 | import xmltodict
import requests
from . import app_settings as settings
class TradingAPIWarning(Exception):
pass
class TradingAPIFailure(Exception):
pass
class TradingAPIInvalidResponse(Exception):
pass
class TradingAPI(object):
_last_response = None
def __init__(self, production=False, si... | true | true |
f70b081736313ab52d82208c2436e124a1ec7ba4 | 2,555 | py | Python | tests/cli/test_keyboard.py | RasaHQ/taipo | 0a0488a591362eca44a7a315cf38f44393b8d209 | [
"MIT"
] | 28 | 2021-06-16T14:08:10.000Z | 2022-03-25T13:26:29.000Z | tests/cli/test_keyboard.py | RasaHQ/taipo | 0a0488a591362eca44a7a315cf38f44393b8d209 | [
"MIT"
] | 16 | 2021-06-29T17:13:48.000Z | 2021-12-13T17:22:13.000Z | tests/cli/test_keyboard.py | RasaHQ/taipo | 0a0488a591362eca44a7a315cf38f44393b8d209 | [
"MIT"
] | 6 | 2021-07-06T17:34:43.000Z | 2022-03-11T10:50:00.000Z | import pathlib
import re
import pytest
from typer.testing import CliRunner
from taipo.__main__ import app
from taipo.common import nlu_path_to_dataframe
runner = CliRunner()
@pytest.mark.parametrize(
"path_in,path_out", [("nlu.yml", "nlu.yml"), ("foobar.yml", "foobar.yml")]
)
def test_keyboard_augment(tmp_path... | 30.058824 | 78 | 0.630137 | import pathlib
import re
import pytest
from typer.testing import CliRunner
from taipo.__main__ import app
from taipo.common import nlu_path_to_dataframe
runner = CliRunner()
@pytest.mark.parametrize(
"path_in,path_out", [("nlu.yml", "nlu.yml"), ("foobar.yml", "foobar.yml")]
)
def test_keyboard_augment(tmp_path... | true | true |
f70b087afb7bff339fcd596ca2064c38ebd2b923 | 7,044 | py | Python | scirpy/tests/test_util.py | ktpolanski/scirpy | 2d6e3a6347ad54425a8dea635fa04609aaf33c57 | [
"BSD-3-Clause"
] | null | null | null | scirpy/tests/test_util.py | ktpolanski/scirpy | 2d6e3a6347ad54425a8dea635fa04609aaf33c57 | [
"BSD-3-Clause"
] | null | null | null | scirpy/tests/test_util.py | ktpolanski/scirpy | 2d6e3a6347ad54425a8dea635fa04609aaf33c57 | [
"BSD-3-Clause"
] | null | null | null | from scirpy.util import (
_is_na,
_is_false,
_is_true,
_normalize_counts,
_is_symmetric,
_reduce_nonzero,
_translate_dna_to_protein,
)
from scirpy.util.graph import layout_components
from itertools import combinations
import igraph as ig
import numpy as np
import pandas as pd
import numpy.te... | 32.611111 | 87 | 0.667376 | from scirpy.util import (
_is_na,
_is_false,
_is_true,
_normalize_counts,
_is_symmetric,
_reduce_nonzero,
_translate_dna_to_protein,
)
from scirpy.util.graph import layout_components
from itertools import combinations
import igraph as ig
import numpy as np
import pandas as pd
import numpy.te... | true | true |
f70b09221802c961e0b9d4fb231642054bff3534 | 3,096 | py | Python | fryptos/main.py | pyohei/encryptfile | 988fa0b2f57c6482d71a81dba3e65ee0ff084048 | [
"MIT"
] | null | null | null | fryptos/main.py | pyohei/encryptfile | 988fa0b2f57c6482d71a81dba3e65ee0ff084048 | [
"MIT"
] | null | null | null | fryptos/main.py | pyohei/encryptfile | 988fa0b2f57c6482d71a81dba3e65ee0ff084048 | [
"MIT"
] | null | null | null | """File path encryption.
Put files to public directory by encryption.
And this anchers of relationship.
This module anable change the anchers.
"""
import glob
import logging
import os
import shutil
try:
from . import filename
from .anchor.anchor import Anchor
except:
import filename
from anchor.anchor ... | 29.207547 | 90 | 0.645995 | import glob
import logging
import os
import shutil
try:
from . import filename
from .anchor.anchor import Anchor
except:
import filename
from anchor.anchor import Anchor
def main(src, dst):
anchor = Anchor('text')
for org_f in _read_files(src):
cur_f = anchor.request_current_path(o... | true | true |
f70b0a9a919f5f4038de5f39bbb1976821f60654 | 24,739 | py | Python | alibi/explainers/anchors/anchor_image.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | alibi/explainers/anchors/anchor_image.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | alibi/explainers/anchors/anchor_image.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import copy
import logging
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
import numpy as np
from skimage.segmentation import felzenszwalb, quickshift, slic
from alibi.api.defaults import DEFAULT_DATA_ANCHOR_IMG, DEFAULT_META_ANCHOR
from alibi.api.interfaces i... | 37.25753 | 120 | 0.606653 | import copy
import logging
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
import numpy as np
from skimage.segmentation import felzenszwalb, quickshift, slic
from alibi.api.defaults import DEFAULT_DATA_ANCHOR_IMG, DEFAULT_META_ANCHOR
from alibi.api.interfaces i... | true | true |
f70b0ccf2f8a3aaf24f11e06fcd65020d064563f | 10,622 | py | Python | jobmon/redisbackend.py | binarybana/jobmon | caf4920955cb5f5f454bcb8ca30bde9ad5fcfd9b | [
"MIT"
] | 1 | 2016-11-25T07:47:24.000Z | 2016-11-25T07:47:24.000Z | jobmon/redisbackend.py | binarybana/jobmon | caf4920955cb5f5f454bcb8ca30bde9ad5fcfd9b | [
"MIT"
] | null | null | null | jobmon/redisbackend.py | binarybana/jobmon | caf4920955cb5f5f454bcb8ca30bde9ad5fcfd9b | [
"MIT"
] | null | null | null | import os
import sys
import time
import hashlib
import zlib
import random
import string
import subprocess as sb
import redis
import json
from collections import Counter
digestsize = 20
class RedisDataStore:
def __init__(self, loc, db=0):
self.conn = redis.StrictRedis(loc, db=db)
def post_experiment(... | 34.154341 | 99 | 0.534174 | import os
import sys
import time
import hashlib
import zlib
import random
import string
import subprocess as sb
import redis
import json
from collections import Counter
digestsize = 20
class RedisDataStore:
def __init__(self, loc, db=0):
self.conn = redis.StrictRedis(loc, db=db)
def post_experiment(... | false | true |
f70b0eece0552cb8650942bf13b7e0fb7ec7bb56 | 27,283 | py | Python | tensor2tensor/models/research/moe.py | kpe/tensor2tensor | 453c473030c354a3d9a4c27b12bcec8942334bf4 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | tensor2tensor/models/research/moe.py | kpe/tensor2tensor | 453c473030c354a3d9a4c27b12bcec8942334bf4 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | tensor2tensor/models/research/moe.py | kpe/tensor2tensor | 453c473030c354a3d9a4c27b12bcec8942334bf4 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 40.122059 | 80 | 0.728549 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mesh_tensorflow as mtf
import tensorflow as tf
def transformer_moe_layer_v1(inputs, output_dim, hparams, train,
master_dtype=tf.bfloat16,
sli... | true | true |
f70b0f4818fe2a2313130690f64f8143214ce044 | 2,082 | py | Python | generator/mnistGenerator.py | Kotwic4/SCOTR | 6afabedb672641a9777d8aa9d7b75f998e53c0c9 | [
"MIT"
] | 2 | 2018-01-15T12:27:10.000Z | 2019-01-30T18:42:29.000Z | generator/mnistGenerator.py | Kotwic4/SCOTR | 6afabedb672641a9777d8aa9d7b75f998e53c0c9 | [
"MIT"
] | null | null | null | generator/mnistGenerator.py | Kotwic4/SCOTR | 6afabedb672641a9777d8aa9d7b75f998e53c0c9 | [
"MIT"
] | null | null | null | import random
from sklearn.datasets import fetch_mldata
from util import open_file_in_directory
MNIST_DIR = './tmp/mnist'
MNIST_TRAIN_DIR = './mnist/train'
MNIST_TEST_DIR = './mnist/test'
MNIST_SAMPLE_DIR = './mnist/sample'
TEST_CASES = 60000
def mnist_img_to_file(mnist_img, file):
for x in range(28):
... | 28.520548 | 92 | 0.67195 | import random
from sklearn.datasets import fetch_mldata
from util import open_file_in_directory
MNIST_DIR = './tmp/mnist'
MNIST_TRAIN_DIR = './mnist/train'
MNIST_TEST_DIR = './mnist/test'
MNIST_SAMPLE_DIR = './mnist/sample'
TEST_CASES = 60000
def mnist_img_to_file(mnist_img, file):
for x in range(28):
... | true | true |
f70b0fff4768688affbca729bacf2b1bd853c80d | 1,547 | py | Python | apt/transport/transport.py | javajawa/debian-repo-remux | b6626b268acd1743208d8a399f8c975316cfbc80 | [
"BSD-2-Clause"
] | 1 | 2019-10-31T08:36:29.000Z | 2019-10-31T08:36:29.000Z | apt/transport/transport.py | javajawa/debian-repo-remux | b6626b268acd1743208d8a399f8c975316cfbc80 | [
"BSD-2-Clause"
] | null | null | null | apt/transport/transport.py | javajawa/debian-repo-remux | b6626b268acd1743208d8a399f8c975316cfbc80 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Abstract Transport
"""
import typing
import abc
from apt.transport.directorylisting import DirectoryListing
class Transport:
"""
Abstract class for retrieving information from repos
The functions 'exists' and 'open_read' are required to be implemented... | 20.626667 | 81 | 0.606981 |
import typing
import abc
from apt.transport.directorylisting import DirectoryListing
class Transport:
@abc.abstractmethod
def exists(self, uri: str) -> bool:
@abc.abstractmethod
def open_read(self, uri: str) -> typing.IO:
@abc.abstractmethod
def open_write(self, uri: str) -> typing.IO:
... | true | true |
f70b102230ce619e7bdf83c48010380e4304b537 | 4,264 | py | Python | biointeract/hub/dataload/sources/ConsensusPathDB/parser.py | biothings/biothings_interactions | 7a8b16e8119d6505b6b5d89623051c11f3649430 | [
"Apache-2.0"
] | null | null | null | biointeract/hub/dataload/sources/ConsensusPathDB/parser.py | biothings/biothings_interactions | 7a8b16e8119d6505b6b5d89623051c11f3649430 | [
"Apache-2.0"
] | null | null | null | biointeract/hub/dataload/sources/ConsensusPathDB/parser.py | biothings/biothings_interactions | 7a8b16e8119d6505b6b5d89623051c11f3649430 | [
"Apache-2.0"
] | null | null | null | """
CPDParser parses the ConsensusPathDB_human_PPI data file and yields
a generated dictionary of values.
Source Project: biothings.interactions
Author: Greg Taylor: greg.k.taylor@gmail.com
"""
import hashlib
import re
from hub.dataload.BiointeractParser import BiointeractParser
class CPDParser(BiointeractParser... | 37.403509 | 111 | 0.64728 | import hashlib
import re
from hub.dataload.BiointeractParser import BiointeractParser
class CPDParser(BiointeractParser):
EMPTY_FIELD = 'NA'
SEPARATOR = ','
HUMAN = '_HUMAN'
@staticmethod
def parse_interaction_participants(entry):
vals = CPDParser.parse_list(entry, CPDParser.SEPARATOR... | true | true |
f70b1091614744431199f5372bcc30b19abcfd96 | 378 | py | Python | tests/test_things.py | 3jackdaws/distributed-asgi | acc341befe29b9e16ccb9da3d8887dff99636b2a | [
"MIT"
] | 1 | 2019-02-23T11:11:52.000Z | 2019-02-23T11:11:52.000Z | tests/test_things.py | 3jackdaws/distributed-asgi | acc341befe29b9e16ccb9da3d8887dff99636b2a | [
"MIT"
] | null | null | null | tests/test_things.py | 3jackdaws/distributed-asgi | acc341befe29b9e16ccb9da3d8887dff99636b2a | [
"MIT"
] | null | null | null | import pytest
from distributed_asgi import create_path_distributor
def test_path_distributor():
dist = create_path_distributor(routes={
"/api/([a-z-]+)": r"\1"
})
for path, expected_key in [
("/api/banana", "banana"),
("/banana", None),
()
]:
instance = dist({"p... | 21 | 52 | 0.582011 | import pytest
from distributed_asgi import create_path_distributor
def test_path_distributor():
dist = create_path_distributor(routes={
"/api/([a-z-]+)": r"\1"
})
for path, expected_key in [
("/api/banana", "banana"),
("/banana", None),
()
]:
instance = dist({"p... | true | true |
f70b10af0be0cb3da3d2d4e4ce538bc6e4775287 | 4,487 | py | Python | metadata_service/__init__.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | null | null | null | metadata_service/__init__.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | 1 | 2019-09-21T23:59:46.000Z | 2019-09-21T23:59:46.000Z | metadata_service/__init__.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | 1 | 2019-09-21T23:56:40.000Z | 2019-09-21T23:56:40.000Z | import ast
import importlib
import logging
import os
import sys
from typing import Dict, Any # noqa: F401
from flask import Flask, Blueprint
from flask_restful import Api
from metadata_service.api.column import ColumnDescriptionAPI
from metadata_service.api.healthcheck import healthcheck
from metadata_service.api.po... | 43.990196 | 107 | 0.696902 | import ast
import importlib
import logging
import os
import sys
from typing import Dict, Any
from flask import Flask, Blueprint
from flask_restful import Api
from metadata_service.api.column import ColumnDescriptionAPI
from metadata_service.api.healthcheck import healthcheck
from metadata_service.api.popular_tables ... | true | true |
f70b128b87482b3cee9323205fe94afb471a66f3 | 5,846 | py | Python | lib-src/lv2/suil/waflib/Tools/c_osx.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 7,892 | 2015-03-31T09:24:05.000Z | 2022-03-31T12:30:32.000Z | lib-src/lv2/suil/waflib/Tools/c_osx.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,050 | 2015-04-03T13:27:52.000Z | 2022-03-31T19:14:10.000Z | lib-src/lv2/suil/waflib/Tools/c_osx.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,613 | 2015-03-26T11:28:10.000Z | 2022-03-30T13:17:03.000Z | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2008-2018 (ita)
"""
MacOSX related tools
"""
import os, shutil, platform
from waflib import Task, Utils
from waflib.TaskGen import taskgen_method, feature, after_method, before_method
app_info = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "f... | 30.134021 | 98 | 0.706295 |
import os, shutil, platform
from waflib import Task, Utils
from waflib.TaskGen import taskgen_method, feature, after_method, before_method
app_info = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleP... | true | true |
f70b13e9224c40649b9bde9fb2b3aa3621b095d9 | 45,694 | py | Python | tests/druid_func_tests.py | longenouvo/incubator-superset | 4e998be6956955041a6d36351f602e27d0c8cbeb | [
"Apache-2.0"
] | 1 | 2020-04-15T18:13:31.000Z | 2020-04-15T18:13:31.000Z | tests/druid_func_tests.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | null | null | null | tests/druid_func_tests.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | 3 | 2020-04-15T16:34:09.000Z | 2020-06-22T17:26:45.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.798214 | 88 | 0.576093 | import json
import unittest
from unittest.mock import Mock
import superset.connectors.druid.models as models
from superset.connectors.druid.models import DruidColumn, DruidDatasource, DruidMetric
from superset.exceptions import SupersetException
from .base_tests import SupersetTestCase
try:
from pydruid.utils.di... | true | true |
f70b14387afbfb856a02ada0d56f10e597f6b54c | 668 | py | Python | esuits/index/views.py | junkhp/esuites_database_modification | ac2b706a7cc8488cbe83a77d7ce062f5b8228463 | [
"MIT"
] | 4 | 2020-11-02T18:25:13.000Z | 2021-03-15T07:56:41.000Z | esuits/index/views.py | junkhp/esuites_database_modification | ac2b706a7cc8488cbe83a77d7ce062f5b8228463 | [
"MIT"
] | 9 | 2021-02-01T03:20:59.000Z | 2021-03-06T08:15:04.000Z | esuits/index/views.py | junkhp/esuites_database_modification | ac2b706a7cc8488cbe83a77d7ce062f5b8228463 | [
"MIT"
] | 4 | 2020-11-03T16:52:37.000Z | 2020-11-11T16:31:26.000Z | from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import ListView, DetailView, DeleteView, UpdateView
from django import forms
from django.urls import reverse_lazy, reverse
from django.views import View
from django.contrib.auth import authenticate, login, logout
from django.cont... | 31.809524 | 77 | 0.791916 | from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import ListView, DetailView, DeleteView, UpdateView
from django import forms
from django.urls import reverse_lazy, reverse
from django.views import View
from django.contrib.auth import authenticate, login, logout
from django.cont... | true | true |
f70b15354c78daddad253c8e050db6e8e7e66e50 | 2,094 | py | Python | tests/test_local.py | gaolichuang/py-essential | 9e2b803f878f1cb3686dd365a16b943594a1cd82 | [
"Apache-2.0"
] | 1 | 2015-01-11T06:43:02.000Z | 2015-01-11T06:43:02.000Z | tests/test_local.py | gaolichuang/py-essential | 9e2b803f878f1cb3686dd365a16b943594a1cd82 | [
"Apache-2.0"
] | null | null | null | tests/test_local.py | gaolichuang/py-essential | 9e2b803f878f1cb3686dd365a16b943594a1cd82 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 30.794118 | 78 | 0.658548 |
import threading
from six import moves
from essential import local
from essential import test
class Dict(dict):
pass
class LocalStoreTestCase(test.BaseTestCase):
v1 = Dict(a='1')
v2 = Dict(a='2')
v3 = Dict(a='3')
def setUp(self):
super(LocalStoreTestCase, self).setUp()
... | true | true |
f70b15ad06c667a6017f75785dfe700e2698982c | 1,310 | py | Python | tests/nn.py | maikka39/Toy-Neural-Network-Py | a76b763e05fb9361a09fc825cdd0dc3606a3cb03 | [
"MIT"
] | null | null | null | tests/nn.py | maikka39/Toy-Neural-Network-Py | a76b763e05fb9361a09fc825cdd0dc3606a3cb03 | [
"MIT"
] | null | null | null | tests/nn.py | maikka39/Toy-Neural-Network-Py | a76b763e05fb9361a09fc825cdd0dc3606a3cb03 | [
"MIT"
] | null | null | null | from random import randint
from tnnp import nn as tnnp
nn = tnnp.NeuralNetwork(2, 2, 1)
if nn is None:
raise Exception("Initialization failed!", m.matrix)
nn = tnnp.NeuralNetwork(2, 2, 1)
input = [1, 0]
output = nn.feedforward(input)
if output < [-1] or output > [1]:
raise Exception(".feedforward function fa... | 23.818182 | 91 | 0.6 | from random import randint
from tnnp import nn as tnnp
nn = tnnp.NeuralNetwork(2, 2, 1)
if nn is None:
raise Exception("Initialization failed!", m.matrix)
nn = tnnp.NeuralNetwork(2, 2, 1)
input = [1, 0]
output = nn.feedforward(input)
if output < [-1] or output > [1]:
raise Exception(".feedforward function fa... | true | true |
f70b16ab99a5af27e7a27a4a42a400263f5c72af | 1,759 | py | Python | superpoint/models/simple_classifier.py | SwagJ/SuperPoint | ecbf1d6e809ea8c7c832078ad26d2a74ed2fae29 | [
"MIT"
] | null | null | null | superpoint/models/simple_classifier.py | SwagJ/SuperPoint | ecbf1d6e809ea8c7c832078ad26d2a74ed2fae29 | [
"MIT"
] | null | null | null | superpoint/models/simple_classifier.py | SwagJ/SuperPoint | ecbf1d6e809ea8c7c832078ad26d2a74ed2fae29 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow import layers as tfl
from .base_model import BaseModel, Mode
class SimpleClassifier(BaseModel):
input_spec = {
'image': {'shape': [None, None, None, 1], 'type': tf.float32}
}
required_config_keys = []
default_config = {'data_format': 'channels_first... | 35.897959 | 89 | 0.583854 | import tensorflow as tf
from tensorflow import layers as tfl
from .base_model import BaseModel, Mode
class SimpleClassifier(BaseModel):
input_spec = {
'image': {'shape': [None, None, None, 1], 'type': tf.float32}
}
required_config_keys = []
default_config = {'data_format': 'channels_first... | true | true |
f70b187b54382fd85b3a73c0c1ad86ac689ae9dc | 3,164 | py | Python | src/python/pipelines/xchem/split_fragnet_candidates.py | Waztom/pipelines | 63ac14d05446ced622fd2acb86c9b84dcc5feae8 | [
"Apache-2.0"
] | 24 | 2017-04-04T19:12:34.000Z | 2022-03-09T16:29:06.000Z | src/python/pipelines/xchem/split_fragnet_candidates.py | Waztom/pipelines | 63ac14d05446ced622fd2acb86c9b84dcc5feae8 | [
"Apache-2.0"
] | 22 | 2017-06-02T07:03:52.000Z | 2021-03-27T09:44:08.000Z | src/python/pipelines/xchem/split_fragnet_candidates.py | Waztom/pipelines | 63ac14d05446ced622fd2acb86c9b84dcc5feae8 | [
"Apache-2.0"
] | 19 | 2017-05-18T10:27:58.000Z | 2021-08-02T10:44:01.000Z | #!/usr/bin/env python
# Copyright 2020 Informatics Matters Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 30.423077 | 149 | 0.596081 |
import argparse, os, sys, json, traceback
from pipelines_utils import utils
from pipelines_utils import utils
def gen_filename(id, generate_filenames):
if generate_filenames:
return str(count)
else:
return id
def execute(candidates_json, generate_filenames):
with open(candidates_json, '... | true | true |
f70b18a4e556bb5a038129fb8aad566e50ed8df6 | 1,008 | py | Python | flarestack/core/astro.py | robertdstein/flarestack | 2ce7e67da336514f6f38f06126a1fbd82131e441 | [
"MIT"
] | null | null | null | flarestack/core/astro.py | robertdstein/flarestack | 2ce7e67da336514f6f38f06126a1fbd82131e441 | [
"MIT"
] | 25 | 2019-11-14T15:46:24.000Z | 2020-11-27T11:14:22.000Z | flarestack/core/astro.py | robertdstein/flarestack | 2ce7e67da336514f6f38f06126a1fbd82131e441 | [
"MIT"
] | 2 | 2020-01-06T19:39:27.000Z | 2020-07-16T20:32:29.000Z | """
Function taken from IceCube astro package.
"""
import numpy as np
def angular_distance(lon1, lat1, lon2, lat2):
"""
calculate the angular distince along the great circle
on the surface of a shpere between the points
(`lon1`,`lat1`) and (`lon2`,`lat2`)
This function Works for equatorial coordin... | 28.8 | 88 | 0.647817 | import numpy as np
def angular_distance(lon1, lat1, lon2, lat2):
c1 = np.cos(lat1)
c2 = np.cos(lat2)
s1 = np.sin(lat1)
s2 = np.sin(lat2)
sd = np.sin(lon2 - lon1)
cd = np.cos(lon2 - lon1)
return np.arctan2(np.hypot(c2 * sd, c1 * s2 - s1 * c2 * cd), s1 * s2 + c1 * c2 * cd)
| true | true |
f70b18b4b2bf16ceeb39c12757922047f07bde3e | 241 | py | Python | Chapter_04/actions/admin.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | 1 | 2021-04-23T16:35:45.000Z | 2021-04-23T16:35:45.000Z | Chapter_04/actions/admin.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | null | null | null | Chapter_04/actions/admin.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Action
@admin.register(Action)
class ActionAdmin(admin.ModelAdmin):
list_display = ('user', 'verb', 'target', 'created')
list_filter = ('created',)
search_fields = ('verb',) | 24.1 | 56 | 0.697095 | from django.contrib import admin
from .models import Action
@admin.register(Action)
class ActionAdmin(admin.ModelAdmin):
list_display = ('user', 'verb', 'target', 'created')
list_filter = ('created',)
search_fields = ('verb',) | true | true |
f70b19e8b33df4c0fab1ab2a6d898931dffda3c0 | 4,205 | py | Python | azury/asynczury/utils.py | citharus/azury.py | 7079f8f98c68028d17114c830e749254cd483ef2 | [
"Apache-2.0"
] | null | null | null | azury/asynczury/utils.py | citharus/azury.py | 7079f8f98c68028d17114c830e749254cd483ef2 | [
"Apache-2.0"
] | null | null | null | azury/asynczury/utils.py | citharus/azury.py | 7079f8f98c68028d17114c830e749254cd483ef2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021-present citharus
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use utils.py except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 31.616541 | 75 | 0.572889 |
from __future__ import annotations
from typing import Union, Dict
import azury.asynczury as asynczury
from azury.utils import parse_iso
__all__: list[str] = ['to_file', 'to_user', 'to_team']
async def to_file(
client: asynczury.Client,
service: str,
data: Dict[str, Union[str, bool, int, li... | true | true |
f70b1b0b16bd605c6b6c84e932a247ada270dac4 | 6,493 | py | Python | pipeline.py | tanynova99/2021-2-level-ctlr | c8a1456c1d719b974f06193e1b7ab4ba0a607229 | [
"MIT"
] | null | null | null | pipeline.py | tanynova99/2021-2-level-ctlr | c8a1456c1d719b974f06193e1b7ab4ba0a607229 | [
"MIT"
] | null | null | null | pipeline.py | tanynova99/2021-2-level-ctlr | c8a1456c1d719b974f06193e1b7ab4ba0a607229 | [
"MIT"
] | null | null | null | """
Pipeline for text processing implementation
"""
from pathlib import Path
import re
import pymorphy2
from pymystem3 import Mystem
from constants import ASSETS_PATH
from core_utils.article import Article, ArtifactType
class EmptyDirectoryError(Exception):
"""
No data to process
"""
class Inconsiste... | 28.108225 | 100 | 0.624365 |
from pathlib import Path
import re
import pymorphy2
from pymystem3 import Mystem
from constants import ASSETS_PATH
from core_utils.article import Article, ArtifactType
class EmptyDirectoryError(Exception):
class InconsistentDatasetError(Exception):
class MorphologicalToken:
def __init__(self, original_wor... | true | true |
f70b1b503b4ddb49f9d18776b11905b96556d553 | 1,458 | py | Python | setup.py | dmitrii-sim/ninjin | 6c3edb46ec873f28ed0b1fcbe20193445e3107e9 | [
"MIT"
] | 2 | 2020-06-03T07:44:46.000Z | 2020-06-05T11:30:46.000Z | setup.py | dmitrii-sim/ninjin | 6c3edb46ec873f28ed0b1fcbe20193445e3107e9 | [
"MIT"
] | null | null | null | setup.py | dmitrii-sim/ninjin | 6c3edb46ec873f28ed0b1fcbe20193445e3107e9 | [
"MIT"
] | 1 | 2020-06-18T15:59:18.000Z | 2020-06-18T15:59:18.000Z | import os
from setuptools import (
find_packages,
setup
)
__version__ = open("VERSION", 'r').read().strip()
REQUIREMENTS_FOLDER = os.getenv('REQUIREMENTS_PATH', '')
requirements = [line.strip() for line in open(os.path.join(REQUIREMENTS_FOLDER, "requirements.txt"), 'r')]
setup(
name='ninjin',
versi... | 26.509091 | 106 | 0.526749 | import os
from setuptools import (
find_packages,
setup
)
__version__ = open("VERSION", 'r').read().strip()
REQUIREMENTS_FOLDER = os.getenv('REQUIREMENTS_PATH', '')
requirements = [line.strip() for line in open(os.path.join(REQUIREMENTS_FOLDER, "requirements.txt"), 'r')]
setup(
name='ninjin',
versi... | true | true |
f70b1b67040779aa3fec10d949f0b6edaadebcce | 4,918 | py | Python | src/prism-fruit/Games-DQL/examples/games/car/networkx/readwrite/sparsegraph6.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/readwrite/sparsegraph6.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/readwrite/sparsegraph6.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | """
**************
SparseGraph 6
**************
Read graphs in graph6 and sparse6 format.
Format
------
"graph6 and sparse6 are formats for storing undirected graphs in a
compact manner, using only printable ASCII characters. Files in these
formats have text type and contain one line per graph."
http://cs... | 28.929412 | 81 | 0.568117 | __author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__all__ = ['read_graph6', 'parse_graph6', 'read_graph6_list',
'read_sparse6', 'parse_sparse6', 'read_sparse6_list']
import networkx as nx
from networkx.exception import NetworkXError
from networkx.utils import open_file
def read_graph6(path):
... | true | true |
f70b1bf7e41ca49a3802c244cb6df05ffb1e5edd | 3,203 | py | Python | mars/dataframe/fetch/core.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | mars/dataframe/fetch/core.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | mars/dataframe/fetch/core.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.590361 | 93 | 0.696222 |
import operator
from ...serialize.core import TupleField, ValueType, Int8Field
from ...operands import Fetch, FetchShuffle
from ...utils import on_serialize_shape, on_deserialize_shape
from ..operands import DataFrameOperandMixin, ObjectType
class DataFrameFetchMixin(DataFrameOperandMixin):
def check_inputs(se... | true | true |
f70b1ca4a8dd551f3d5221559de70f07c52b4a6d | 1,206 | py | Python | ssseg/cfgs/memorynet/cfgs_cocostuff_resnet101os8.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 41 | 2021-08-28T01:29:19.000Z | 2022-03-30T11:28:37.000Z | ssseg/cfgs/memorynet/cfgs_cocostuff_resnet101os8.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 6 | 2021-08-31T08:54:39.000Z | 2021-11-02T10:45:47.000Z | ssseg/cfgs/memorynet/cfgs_cocostuff_resnet101os8.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 1 | 2021-09-08T01:41:10.000Z | 2021-09-08T01:41:10.000Z | '''define the config file for cocostuff and resnet101os8'''
import os
from .base_cfg import *
# modify dataset config
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'cocostuff',
'rootdir': os.path.join(os.getcwd(), 'COCO'),
})
# modify dataloader config
DATALOADER_CFG = DATALOADER_CFG.copy()
# ... | 26.217391 | 110 | 0.722222 | import os
from .base_cfg import *
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'cocostuff',
'rootdir': os.path.join(os.getcwd(), 'COCO'),
})
DATALOADER_CFG = DATALOADER_CFG.copy()
OPTIMIZER_CFG = OPTIMIZER_CFG.copy()
OPTIMIZER_CFG.update(
{
'max_epochs': 30
}
)
LOSSES_CFG = LO... | true | true |
f70b1daf8d65cc9109c42a04aba4fff0fcbd1f13 | 5,875 | py | Python | bgp/simglucose/controller/basal_bolus_ctrller.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | bgp/simglucose/controller/basal_bolus_ctrller.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | bgp/simglucose/controller/basal_bolus_ctrller.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | from .base import Controller
from .base import Action
import numpy as np
import pandas as pd
import pkg_resources
import logging
from collections import namedtuple
logger = logging.getLogger(__name__)
CONTROL_QUEST = '/source/dir/simglucose/params/Quest.csv'
PATIENT_PARA_FILE = '/source/dir/simglucose/params/vpatient_... | 35.179641 | 99 | 0.580766 | from .base import Controller
from .base import Action
import numpy as np
import pandas as pd
import pkg_resources
import logging
from collections import namedtuple
logger = logging.getLogger(__name__)
CONTROL_QUEST = '/source/dir/simglucose/params/Quest.csv'
PATIENT_PARA_FILE = '/source/dir/simglucose/params/vpatient_... | true | true |
f70b1e2720f8ee99979dca1f565540a31b3627d9 | 11,404 | py | Python | gcloud/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | gcloud/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | gcloud/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.52648 | 79 | 0.623202 |
import json
from pkg_resources import get_distribution
import six
from six.moves.urllib.parse import urlencode
import httplib2
from gcloud.credentials import get_credentials
from gcloud.exceptions import make_exception
API_BASE_URL = 'https://www.googleapis.com'
class Connection(object):
USER_AGENT = "gcl... | true | true |
f70b1e86c28d848a3ed36c803e303c1039a3b3d1 | 2,642 | py | Python | thorpy/elements/text.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | 1 | 2020-02-23T13:06:02.000Z | 2020-02-23T13:06:02.000Z | thorpy/elements/text.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | null | null | null | thorpy/elements/text.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | null | null | null | from __future__ import division
from thorpy.elements.element import Element
from thorpy.miscgui.constants import STATE_NORMAL
class OneLineText(Element):
def __init__(self, text="", elements=None, normal_params=None):
Element.__init__(self, text, elements, normal_params)
def finish(self):
s... | 33.025 | 78 | 0.604845 | from __future__ import division
from thorpy.elements.element import Element
from thorpy.miscgui.constants import STATE_NORMAL
class OneLineText(Element):
def __init__(self, text="", elements=None, normal_params=None):
Element.__init__(self, text, elements, normal_params)
def finish(self):
s... | true | true |
f70b1f86cf5fd83b8b23b2fcca78763698db8f0f | 114 | py | Python | src/vm/__init__.py | mingz2013/lang-py | 1788bae92cbc8b5f3f99d9ae1c45ea116d870d91 | [
"Apache-2.0"
] | null | null | null | src/vm/__init__.py | mingz2013/lang-py | 1788bae92cbc8b5f3f99d9ae1c45ea116d870d91 | [
"Apache-2.0"
] | null | null | null | src/vm/__init__.py | mingz2013/lang-py | 1788bae92cbc8b5f3f99d9ae1c45ea116d870d91 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@FileName: __init__.py
@Time: 2020/2/7 20:11
@Author: zhaojm
Module Description
"""
| 11.4 | 23 | 0.622807 | true | true | |
f70b206f88d8d3a4cabcf553b9de5db1cefe513c | 228 | py | Python | sitepackages/djangae/models.py | bitcpf/djangoage | f116860cbfa799eb6c47306a72d742b63c970dce | [
"Apache-2.0"
] | null | null | null | sitepackages/djangae/models.py | bitcpf/djangoage | f116860cbfa799eb6c47306a72d742b63c970dce | [
"Apache-2.0"
] | null | null | null | sitepackages/djangae/models.py | bitcpf/djangoage | f116860cbfa799eb6c47306a72d742b63c970dce | [
"Apache-2.0"
] | null | null | null | from django.db import models
from djangae import patches
class CounterShard(models.Model):
count = models.PositiveIntegerField()
label = models.CharField(max_length=500)
class Meta:
app_label = "djangae"
| 19 | 44 | 0.723684 | from django.db import models
from djangae import patches
class CounterShard(models.Model):
count = models.PositiveIntegerField()
label = models.CharField(max_length=500)
class Meta:
app_label = "djangae"
| true | true |
f70b2195d3e92beb097b41bf27615ee7cb7b8faa | 489 | py | Python | galeria/migrations/0006_alter_post_published.py | JoseDevApps/Pets | 280e193c5bb293893a2baa547fcde0141f5db010 | [
"MIT"
] | null | null | null | galeria/migrations/0006_alter_post_published.py | JoseDevApps/Pets | 280e193c5bb293893a2baa547fcde0141f5db010 | [
"MIT"
] | null | null | null | galeria/migrations/0006_alter_post_published.py | JoseDevApps/Pets | 280e193c5bb293893a2baa547fcde0141f5db010 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-11-11 05:59
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('galeria', '0005_auto_20211111_0052'),
]
operations = [
migrations.AlterField(
model_name='post',
nam... | 24.45 | 136 | 0.633947 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('galeria', '0005_auto_20211111_0052'),
]
operations = [
migrations.AlterField(
model_name='post',
name='published',
field=models.DateTime... | true | true |
f70b22555f264ff3a1b0984a03ecb595e0901e16 | 865 | py | Python | practice/practice/spiders/authors.py | Soulzerz/py_web_crawler | 13f66611703ce253ac85f914cabe3b851138f966 | [
"MIT"
] | null | null | null | practice/practice/spiders/authors.py | Soulzerz/py_web_crawler | 13f66611703ce253ac85f914cabe3b851138f966 | [
"MIT"
] | null | null | null | practice/practice/spiders/authors.py | Soulzerz/py_web_crawler | 13f66611703ce253ac85f914cabe3b851138f966 | [
"MIT"
] | null | null | null | from scrapy import Spider
class AuthorSpider(Spider):
name = 'author'
start_urls = [
'http://quotes.toscrape.com/',
]
def parse(self, response):
#follow links to author pages
for href in response.css('.author + a::attr(href)'):
yield response.follow(href, ca... | 34.6 | 69 | 0.60578 | from scrapy import Spider
class AuthorSpider(Spider):
name = 'author'
start_urls = [
'http://quotes.toscrape.com/',
]
def parse(self, response):
for href in response.css('.author + a::attr(href)'):
yield response.follow(href, callback=self.parse_author)
... | true | true |
f70b22fe0f0e714035cf9a82676dd1c359a9668f | 6,912 | py | Python | tests/use_cases/test_environments.py | namuan/orkestra | 83b67f7e816c94b75232691c14d91fd9d62213ed | [
"MIT"
] | null | null | null | tests/use_cases/test_environments.py | namuan/orkestra | 83b67f7e816c94b75232691c14d91fd9d62213ed | [
"MIT"
] | 11 | 2020-06-07T12:29:21.000Z | 2020-06-24T19:44:36.000Z | tests/use_cases/test_environments.py | namuan/orkestra | 83b67f7e816c94b75232691c14d91fd9d62213ed | [
"MIT"
] | null | null | null | from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialogButtonBox
from . import get_main_window, close_application
NO_OF_ENVIRONMENTS = 5
NO_OF_ENVIRONMENTS_TO_DELETE = 3
NO_OF_ENVIRONMENTS_TO_RE_ADD = 1
def get_toolbar_environments_combo(window):
return window.environment_list_v... | 30.183406 | 109 | 0.757813 | from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialogButtonBox
from . import get_main_window, close_application
NO_OF_ENVIRONMENTS = 5
NO_OF_ENVIRONMENTS_TO_DELETE = 3
NO_OF_ENVIRONMENTS_TO_RE_ADD = 1
def get_toolbar_environments_combo(window):
return window.environment_list_v... | true | true |
f70b230a8610bab237b7c392f0f4b340a61d5e65 | 1,343 | py | Python | tests/integration/test_main.py | benjaminkaplanphd/traveling-salesperson | 5c788554fe90eeb81b6351aeec96f1d64caa7591 | [
"MIT"
] | null | null | null | tests/integration/test_main.py | benjaminkaplanphd/traveling-salesperson | 5c788554fe90eeb81b6351aeec96f1d64caa7591 | [
"MIT"
] | null | null | null | tests/integration/test_main.py | benjaminkaplanphd/traveling-salesperson | 5c788554fe90eeb81b6351aeec96f1d64caa7591 | [
"MIT"
] | null | null | null | """
Integration tests for __main__.py
"""
# pragma pylint: disable=redefined-outer-name
from click.testing import CliRunner
import pytest
from traveling_salesperson import __main__ as main
def test_main_runs(mocker, filename_fixture):
"""Ensures that main() runs smoothly over a test file."""
mock_etl = mocke... | 35.342105 | 89 | 0.673864 | from click.testing import CliRunner
import pytest
from traveling_salesperson import __main__ as main
def test_main_runs(mocker, filename_fixture):
mock_etl = mocker.spy(main, 'etl')
mock_distance = mocker.spy(main, 'distance_matrix')
mock_path = mocker.spy(main, 'determine_path')
mock_plot = mocker.s... | true | true |
f70b234b83f03ff4de13d1a4d9fb1f4827faa4cb | 1,513 | py | Python | scripts/populate_affected_record_for_make_VT.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | scripts/populate_affected_record_for_make_VT.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | scripts/populate_affected_record_for_make_VT.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | #!_PYTHONLOC
#
# (C) COPYRIGHT 2020 Ahasuerus
# ALL RIGHTS RESERVED
#
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# Version: $Revision: 418 $
# Date: $Date: 2019-05-15 10:10:07 -0400 (Wed, 15 May 2019) $
import cgi
import sys
i... | 27.509091 | 115 | 0.660278 |
import cgi
import sys
import os
import string
import MySQLdb
from localdefs import *
from library import *
def Date_or_None(s):
return s
def IsfdbConvSetup():
import MySQLdb.converters
IsfdbConv = MySQLdb.converters.conversions
IsfdbConv[10] = Date_or_None
return(IsfdbConv)
if ... | false | true |
f70b236aca7e96af4bd08a8c9e8e52cae3f487e5 | 544 | py | Python | src/astrolib/util/constants.py | space-geek/integrationutils | 384375702a6c053aa2e5aaca6b9d5c43d86a16ad | [
"MIT"
] | null | null | null | src/astrolib/util/constants.py | space-geek/integrationutils | 384375702a6c053aa2e5aaca6b9d5c43d86a16ad | [
"MIT"
] | null | null | null | src/astrolib/util/constants.py | space-geek/integrationutils | 384375702a6c053aa2e5aaca6b9d5c43d86a16ad | [
"MIT"
] | null | null | null | """ TODO Module docstring
"""
# Threshold value under which a float will be treated as zero
MAX_ZERO_THRESHOLD_VALUE = 1.0e-14
# Minimum integration step size, in seconds
MINIMUM_STEP_SIZE_IN_SECONDS = 1.0e-9
# Number of whole nanoseconds per second
NANOSECONDS_PER_SECOND = int(1e9)
# Number of seconds per mean so... | 21.76 | 61 | 0.773897 |
MAX_ZERO_THRESHOLD_VALUE = 1.0e-14
MINIMUM_STEP_SIZE_IN_SECONDS = 1.0e-9
NANOSECONDS_PER_SECOND = int(1e9)
SECONDS_PER_SOLAR_DAY = 86400.0
SECONDS_PER_MINUTE = 60.0
SECONDS_PER_HOUR = 3600.0
EARTH_MU = 3.986004418e5
| true | true |
f70b23f1200f4265cbd2958a15e879a5f263f877 | 10,005 | py | Python | src/dataload/__init__.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | src/dataload/__init__.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | src/dataload/__init__.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | '''data_load module is for loading individual genedocs from various data sources.'''
from __future__ import print_function
import sys
import copy
import types
import time
import datetime
import importlib
from biothings.utils.mongo import get_src_conn, get_src_dump, get_data_folder
from biothings.utils.common import get... | 35.105263 | 144 | 0.593303 | from __future__ import print_function
import sys
import copy
import types
import time
import datetime
import importlib
from biothings.utils.mongo import get_src_conn, get_src_dump, get_data_folder
from biothings.utils.common import get_timestamp, get_random_string, timesofar, dump2gridfs, iter_n
from config import DATA... | true | true |
f70b274505cb775f5dfe8ee0c0eddac1fc9d3788 | 798 | py | Python | rendering/tasks.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 5 | 2019-07-01T17:50:44.000Z | 2022-02-20T02:44:42.000Z | rendering/tasks.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 3 | 2020-06-05T21:44:33.000Z | 2021-06-10T21:39:26.000Z | rendering/tasks.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 1 | 2021-12-09T06:32:40.000Z | 2021-12-09T06:32:40.000Z | """Rendering Related Tasks"""
from celery import shared_task
import newrelic.agent
from rendering.render_email import compose_email
from mailer.mailserver import deliver
@shared_task
def sample_email(to_address, user_id, email_id, election_id, district_ids):
"""Sample an email to an end user"""
result = comp... | 26.6 | 75 | 0.692982 | from celery import shared_task
import newrelic.agent
from rendering.render_email import compose_email
from mailer.mailserver import deliver
@shared_task
def sample_email(to_address, user_id, email_id, election_id, district_ids):
result = compose_email(
user_id,
email_id,
election_id,
... | true | true |
f70b27fea3ce5edeff7e9b072b5f43440d39c19d | 3,763 | py | Python | staff_manage_sdk/model/cmdb_extend/idcrack_unit_info_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | webshell_sdk/model/cmdb_extend/idcrack_unit_info_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | webshell_sdk/model/cmdb_extend/idcrack_unit_info_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: idcrack_unit_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pr... | 39.197917 | 396 | 0.766144 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
f70b2818b2e1e54a65dde52029d6950bf731af54 | 1,296 | py | Python | ThreeBotPackages/threebot/capacity/package.py | grimpy/jumpscaleX_threebot | 81aab3f049b2b353c247cd2c9eecd759a34a64c3 | [
"Apache-2.0"
] | null | null | null | ThreeBotPackages/threebot/capacity/package.py | grimpy/jumpscaleX_threebot | 81aab3f049b2b353c247cd2c9eecd759a34a64c3 | [
"Apache-2.0"
] | null | null | null | ThreeBotPackages/threebot/capacity/package.py | grimpy/jumpscaleX_threebot | 81aab3f049b2b353c247cd2c9eecd759a34a64c3 | [
"Apache-2.0"
] | null | null | null | from Jumpscale import j
class Package(j.baseclasses.threebot_package):
def prepare(self):
"""
is called at install time
:return:
"""
pass
def start(self):
"""
called when the 3bot starts
:return:
"""
## TODO: BAD
# self.d... | 25.411765 | 89 | 0.588735 | from Jumpscale import j
class Package(j.baseclasses.threebot_package):
def prepare(self):
pass
def start(self):
server = self.openresty
website = server.get_from_port(443)
locations = website.locations.get("threebotapp_locations")
website_lo... | true | true |
f70b281ecb804bd367a615bc4a4bbf8209ed8eb9 | 101 | py | Python | classwork1/classworkApp1/apps.py | cs-fullstack-2019-spring/django-intro1-cw-itayanna | 5c4d577f890991ef78c2f98203c8deda65c04357 | [
"Apache-2.0"
] | null | null | null | classwork1/classworkApp1/apps.py | cs-fullstack-2019-spring/django-intro1-cw-itayanna | 5c4d577f890991ef78c2f98203c8deda65c04357 | [
"Apache-2.0"
] | null | null | null | classwork1/classworkApp1/apps.py | cs-fullstack-2019-spring/django-intro1-cw-itayanna | 5c4d577f890991ef78c2f98203c8deda65c04357 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class Classworkapp1Config(AppConfig):
name = 'classworkApp1'
| 16.833333 | 37 | 0.782178 | from django.apps import AppConfig
class Classworkapp1Config(AppConfig):
name = 'classworkApp1'
| true | true |
f70b29879a3f4ffccc12dfdfa056f63e5c01bae8 | 754 | py | Python | 2018/day03/solve.py | greenbender/aoc2018 | 0865214a1acd2025d8702054ed8b8882a03a2d5a | [
"Apache-2.0"
] | null | null | null | 2018/day03/solve.py | greenbender/aoc2018 | 0865214a1acd2025d8702054ed8b8882a03a2d5a | [
"Apache-2.0"
] | null | null | null | 2018/day03/solve.py | greenbender/aoc2018 | 0865214a1acd2025d8702054ed8b8882a03a2d5a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
def to_claim(line):
cid, _, location, dimensions = line.split()
cid = int(cid[1:])
x, y = map(int, location[:-1].split(','))
w, h = map(int, dimensions.split('x'))
return cid, x, y, w, h
claims = map(to_claim, sys.stdin)
# build bitmap
bitmap = [None] * (1000 * 1... | 17.534884 | 57 | 0.54244 |
import sys
def to_claim(line):
cid, _, location, dimensions = line.split()
cid = int(cid[1:])
x, y = map(int, location[:-1].split(','))
w, h = map(int, dimensions.split('x'))
return cid, x, y, w, h
claims = map(to_claim, sys.stdin)
bitmap = [None] * (1000 * 1000)
for cid, x0, y0, w, h in cla... | false | true |
f70b29e2ae59baf04fbe095ef1fe4e2a9c27ec3a | 7,212 | py | Python | plyse/term_parser.py | arcodergh/plyse | bb44543f9c812401489ceba68b24b8618d263830 | [
"MIT"
] | 26 | 2016-05-31T14:45:24.000Z | 2021-04-27T01:54:52.000Z | plyse/term_parser.py | arcodergh/plyse | bb44543f9c812401489ceba68b24b8618d263830 | [
"MIT"
] | 11 | 2016-05-31T20:09:57.000Z | 2022-02-18T11:43:50.000Z | plyse/term_parser.py | arcodergh/plyse | bb44543f9c812401489ceba68b24b8618d263830 | [
"MIT"
] | 13 | 2016-05-31T19:41:36.000Z | 2021-03-01T15:22:38.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .util import load_module
class TermParserFactory(object):
@staticmethod
def build_from_conf(conf):
args = {k: conf[k] for k in ['default_fields', 'aliases', 'integer_as_string'] if k in conf}
return TermParser(**args) if not 'class' in conf else... | 36.984615 | 122 | 0.640044 | from .util import load_module
class TermParserFactory(object):
@staticmethod
def build_from_conf(conf):
args = {k: conf[k] for k in ['default_fields', 'aliases', 'integer_as_string'] if k in conf}
return TermParser(**args) if not 'class' in conf else load_module(conf['class'])(**args)
@... | true | true |
f70b2a813717d6b844f5a5aa9a42bc87923adf2a | 7,571 | py | Python | bluetail/models/ocds_models.py | CodeForAfrica/bluetail | 776e9f2993b6bc91c5ab0337fca4efcbaa1c320d | [
"MIT"
] | 1 | 2022-01-31T08:18:35.000Z | 2022-01-31T08:18:35.000Z | bluetail/models/ocds_models.py | CodeForAfrica/bluetail | 776e9f2993b6bc91c5ab0337fca4efcbaa1c320d | [
"MIT"
] | 1 | 2022-02-03T06:53:36.000Z | 2022-02-03T10:22:33.000Z | bluetail/models/ocds_models.py | CodeForAfrica/bluetail | 776e9f2993b6bc91c5ab0337fca4efcbaa1c320d | [
"MIT"
] | null | null | null | from django.contrib.postgres.fields import JSONField
from django.db import models
from django_pgviews import view as pgviews
from cove.input.models import SuppliedData
from .bluetail_models import Flag
class OCDSPackageDataJSON(models.Model):
"""
Model to store OCDS JSON package data.
"""
package_dat... | 36.752427 | 129 | 0.632941 | from django.contrib.postgres.fields import JSONField
from django.db import models
from django_pgviews import view as pgviews
from cove.input.models import SuppliedData
from .bluetail_models import Flag
class OCDSPackageDataJSON(models.Model):
package_data = JSONField(null=True)
supplied_data = models.Foreign... | true | true |
f70b2ab2a3782f1d53ea23d291f9fea3c10fe878 | 7,613 | py | Python | lib/tools/common.py | rowlap/ganeti | 8ed853a8ec86cd9c295a086403a0ddd8c36c8173 | [
"BSD-2-Clause"
] | 1 | 2022-01-30T01:46:46.000Z | 2022-01-30T01:46:46.000Z | lib/tools/common.py | seanpm2001/ganeti | 9129897cbe631bac198cbb432074bde789c6c29e | [
"BSD-2-Clause"
] | null | null | null | lib/tools/common.py | seanpm2001/ganeti | 9129897cbe631bac198cbb432074bde789c6c29e | [
"BSD-2-Clause"
] | null | null | null | #
#
# Copyright (C) 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | 30.210317 | 80 | 0.720609 |
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import logging
import os
import time
from io import StringIO
import OpenSSL
from ganeti import constants
from ganeti import errors
from ganeti import pathutils
from ganeti import utils
from ganeti import serializer
from ganeti import ssconf
f... | true | true |
f70b2b2cddf15273b70142530c473aa2b5c66fe5 | 11,360 | py | Python | meraki/controllers/saml_roles_controller.py | bossypants22/python-sdk-test | 37701d62dc18c2abb910eb790ab978913adcaf7b | [
"MIT"
] | null | null | null | meraki/controllers/saml_roles_controller.py | bossypants22/python-sdk-test | 37701d62dc18c2abb910eb790ab978913adcaf7b | [
"MIT"
] | null | null | null | meraki/controllers/saml_roles_controller.py | bossypants22/python-sdk-test | 37701d62dc18c2abb910eb790ab978913adcaf7b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
meraki
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
from meraki.api_helper import APIHelper
from meraki.configuration import Configuration
from meraki.controllers.base_controller import BaseController
from meraki.http.au... | 39.859649 | 154 | 0.603081 |
from meraki.api_helper import APIHelper
from meraki.configuration import Configuration
from meraki.controllers.base_controller import BaseController
from meraki.http.auth.custom_header_auth import CustomHeaderAuth
class SAMLRolesController(BaseController):
def get_organization_saml_roles(self,
... | true | true |
f70b2c2919f1a0e38a2129982ef8b02639dfb5a5 | 2,171 | py | Python | credential.py | fiona-niwiduhaye/python-password-locker | aaed8ceac7f1dc0301db9d20594413ffd2e0b9ab | [
"Unlicense"
] | null | null | null | credential.py | fiona-niwiduhaye/python-password-locker | aaed8ceac7f1dc0301db9d20594413ffd2e0b9ab | [
"Unlicense"
] | null | null | null | credential.py | fiona-niwiduhaye/python-password-locker | aaed8ceac7f1dc0301db9d20594413ffd2e0b9ab | [
"Unlicense"
] | null | null | null |
class Credential:
'''
Class that generates instances of a users credentials
'''
# Empty list of credentials
credential_list = []
def __init__(self, user_password, credential_name, credential_password):
'''
__init__ method to define the properties of a User object
Args:
... | 28.194805 | 82 | 0.605251 |
class Credential:
credential_list = []
def __init__(self, user_password, credential_name, credential_password):
self.user_password = user_password
self.credential_name = credential_name
self.credential_password = credential_password
def save_credential(self):
Credentia... | true | true |
f70b2cd894737b29ceab7431ed16bf4467dc58e5 | 2,306 | py | Python | tests/test_autoregressive.py | ai-di/Brancher | 01d51137b0e6fc81512994c21cc3a19287353767 | [
"MIT"
] | 208 | 2019-06-15T13:48:40.000Z | 2021-10-16T05:03:46.000Z | tests/test_autoregressive.py | ai-di/Brancher | 01d51137b0e6fc81512994c21cc3a19287353767 | [
"MIT"
] | 18 | 2019-06-17T11:22:13.000Z | 2019-09-26T10:45:59.000Z | tests/test_autoregressive.py | ai-di/Brancher | 01d51137b0e6fc81512994c21cc3a19287353767 | [
"MIT"
] | 32 | 2019-06-15T19:08:53.000Z | 2020-02-16T13:39:41.000Z | import matplotlib.pyplot as plt
import numpy as np
from brancher.variables import RootVariable, RandomVariable, ProbabilisticModel
from brancher.standard_variables import NormalVariable, LogNormalVariable, BetaVariable
from brancher import inference
import brancher.functions as BF
# Probabilistic model #
T = 100
nu ... | 32.942857 | 87 | 0.702082 | import matplotlib.pyplot as plt
import numpy as np
from brancher.variables import RootVariable, RandomVariable, ProbabilisticModel
from brancher.standard_variables import NormalVariable, LogNormalVariable, BetaVariable
from brancher import inference
import brancher.functions as BF
T = 100
nu = LogNormalVariable(0.3,... | true | true |
f70b2dba7099f61d4cf65957484d07a3eb6e18bf | 21,084 | py | Python | madgraph/iolibs/template_files/subtraction/commons/beam_factorization_BF.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 1 | 2019-12-14T15:25:38.000Z | 2019-12-14T15:25:38.000Z | madgraph/iolibs/template_files/subtraction/commons/beam_factorization_BF.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 26 | 2018-10-08T15:49:32.000Z | 2020-05-15T13:33:36.000Z | madgraph/iolibs/template_files/subtraction/commons/beam_factorization_BF.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 2 | 2019-03-25T17:28:48.000Z | 2021-04-21T12:15:53.000Z | ##########################################################################################
#
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix elements for arb... | 44.859574 | 125 | 0.5738 |
import os
import math
from madgraph.core.base_objects import EpsilonExpansion
import madgraph.various.misc as misc
import commons.utils as utils
import commons.QCD_local_currents as currents
import commons.factors_and_cuts as factors_and_cuts
from commons.integrated_current_expressions import HE
pjoin = os.path.jo... | true | true |
f70b2df2d3725fc71df008004b4b4b9536a2e2e3 | 11,174 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_authorizationpolicy_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_authorizationpolicy_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_authorizationpolicy_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 30.446866 | 303 | 0.727761 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro... | true | true |
f70b2e7d6d785782beab4bceff912f823fd8f608 | 2,048 | py | Python | myvenv/Lib/site-packages/graphene/utils/deprecated.py | Fa67/saleor-shop | 76110349162c54c8bfcae61983bb59ba8fb0f778 | [
"BSD-3-Clause"
] | 1 | 2020-03-14T11:00:14.000Z | 2020-03-14T11:00:14.000Z | graphene/utils/deprecated.py | djedi/graphene | 2cc701f444f29fc24b4ecf801e906e0f17954c46 | [
"MIT"
] | null | null | null | graphene/utils/deprecated.py | djedi/graphene | 2cc701f444f29fc24b4ecf801e906e0f17954c46 | [
"MIT"
] | 1 | 2020-07-23T17:53:27.000Z | 2020-07-23T17:53:27.000Z | import functools
import inspect
import warnings
string_types = (type(b''), type(u''))
def warn_deprecation(text):
warnings.simplefilter('always', DeprecationWarning)
warnings.warn(
text,
category=DeprecationWarning,
stacklevel=2
)
warnings.simplefilter('default', DeprecationWa... | 25.283951 | 71 | 0.552246 | import functools
import inspect
import warnings
string_types = (type(b''), type(u''))
def warn_deprecation(text):
warnings.simplefilter('always', DeprecationWarning)
warnings.warn(
text,
category=DeprecationWarning,
stacklevel=2
)
warnings.simplefilter('default', DeprecationWa... | true | true |
f70b30d771a35c7efbe0ded4d37ce49fadffd46f | 3,958 | py | Python | tensorflow_hub/tools/module_search/search.py | AyazSaiyed/hub | 597c5726fd72d17f562bffec25e114115dadcac5 | [
"Apache-2.0"
] | null | null | null | tensorflow_hub/tools/module_search/search.py | AyazSaiyed/hub | 597c5726fd72d17f562bffec25e114115dadcac5 | [
"Apache-2.0"
] | null | null | null | tensorflow_hub/tools/module_search/search.py | AyazSaiyed/hub | 597c5726fd72d17f562bffec25e114115dadcac5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 31.165354 | 81 | 0.6905 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
import pandas as pd
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_hub.tools.module_search import utils
FLAGS = flags.FLAGS
flags.DEFINE_st... | true | true |
f70b31d56870f47049de83d268a95ddd4d102068 | 597 | py | Python | Cocos2dx-3x/PhotoExample/cocos2d/tools/jenkins-scripts/configs/cocos-2dx-develop-base-repo.py | ezibyte/EziSocial-PhotoExample | 12818880696d3f76ffd5b66646bab21fa3619821 | [
"Apache-2.0"
] | 14 | 2015-01-29T08:41:15.000Z | 2017-09-03T14:29:32.000Z | Cocos2dx-3x/PhotoExample/cocos2d/tools/jenkins-scripts/configs/cocos-2dx-develop-base-repo.py | ezibyte/EziSocial-PhotoExample | 12818880696d3f76ffd5b66646bab21fa3619821 | [
"Apache-2.0"
] | 1 | 2016-09-20T10:54:53.000Z | 2016-09-20T10:54:53.000Z | Cocos2dx-3x/PhotoExample/cocos2d/tools/jenkins-scripts/configs/cocos-2dx-develop-base-repo.py | ezibyte/EziSocial-PhotoExample | 12818880696d3f76ffd5b66646bab21fa3619821 | [
"Apache-2.0"
] | 22 | 2015-01-05T08:07:50.000Z | 2019-03-25T07:52:48.000Z | import os
import sys
def check_ret(ret):
if(ret != 0):
os.system('git checkout -B develop remotes/origin/develop')
os.system('git clean -xdf -f')
sys.exit(1)
branchs = ['develop', 'master']
for item in branchs:
os.system('git clean -xdf -f')
os.system('git checkout -B ' + item + ' remotes/origin/' +... | 25.956522 | 66 | 0.663317 | import os
import sys
def check_ret(ret):
if(ret != 0):
os.system('git checkout -B develop remotes/origin/develop')
os.system('git clean -xdf -f')
sys.exit(1)
branchs = ['develop', 'master']
for item in branchs:
os.system('git clean -xdf -f')
os.system('git checkout -B ' + item + ' remotes/origin/' +... | true | true |
f70b3234c9f1d13265bf86914670fa4ef4dbce17 | 8,382 | py | Python | Calculator/calculator.py | wuhaowei/tkinter-projects | b2ce55d1d347316cc7d37d5180847b67c19dd413 | [
"MIT"
] | null | null | null | Calculator/calculator.py | wuhaowei/tkinter-projects | b2ce55d1d347316cc7d37d5180847b67c19dd413 | [
"MIT"
] | null | null | null | Calculator/calculator.py | wuhaowei/tkinter-projects | b2ce55d1d347316cc7d37d5180847b67c19dd413 | [
"MIT"
] | 1 | 2021-02-20T05:29:31.000Z | 2021-02-20T05:29:31.000Z | """
Name: Tkinter Exercise - a simple calculator
Description: iOS calculator simulator
Date: 2/21/2018
Author: Haowei Wu
"""
import tkinter
class Calculator:
# Params
app_title = "A simple calculator"
disp_font = ("Helvetica", 25, "bold")
btn_font = ("Helvetica", 20, "bo... | 41.91 | 124 | 0.547721 |
import tkinter
class Calculator:
app_title = "A simple calculator"
disp_font = ("Helvetica", 25, "bold")
btn_font = ("Helvetica", 20, "bold")
def __init__(self, root):
self.root = root
self.initialize()
def initialize(self):
self.ans = "0"
self.ope... | true | true |
f70b32e22f1f29ab259a93726874b66aebcfe48d | 1,952 | py | Python | kmall_player.test.py | monsterkittykitty/kmall | 270c9d70de0b0b59dfa56d50db0466e655831e96 | [
"CC0-1.0"
] | null | null | null | kmall_player.test.py | monsterkittykitty/kmall | 270c9d70de0b0b59dfa56d50db0466e655831e96 | [
"CC0-1.0"
] | null | null | null | kmall_player.test.py | monsterkittykitty/kmall | 270c9d70de0b0b59dfa56d50db0466e655831e96 | [
"CC0-1.0"
] | 1 | 2020-12-02T09:00:06.000Z | 2020-12-02T09:00:06.000Z | import unittest
import pandas as pd
import os
from kmall_player import *
class KmallPlayerTest(unittest.TestCase):
def setUp(self) -> None:
file_name = "data/MRZ_LARGE_SIZE.kmall"
self.f = open(file_name, "rb")
self.file_size = os.fstat(self.f.fileno()).st_size
self.player = KmallP... | 39.836735 | 108 | 0.67418 | import unittest
import pandas as pd
import os
from kmall_player import *
class KmallPlayerTest(unittest.TestCase):
def setUp(self) -> None:
file_name = "data/MRZ_LARGE_SIZE.kmall"
self.f = open(file_name, "rb")
self.file_size = os.fstat(self.f.fileno()).st_size
self.player = KmallP... | true | true |
f70b34cdd9079c1a5bc04d0c71dc0e1703742f90 | 161 | py | Python | csv_cti/blueprints/fs_api/__init__.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | csv_cti/blueprints/fs_api/__init__.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | csv_cti/blueprints/fs_api/__init__.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | from flask import Blueprint
fs_api=Blueprint('fs_api',__name__,template_folder='templates')
from .views import configuration,dialplan,directory,vars,update_cdr | 32.2 | 67 | 0.84472 | from flask import Blueprint
fs_api=Blueprint('fs_api',__name__,template_folder='templates')
from .views import configuration,dialplan,directory,vars,update_cdr | true | true |
f70b35370574700e30c9df6e34e34f4182ba4a8c | 34,208 | py | Python | captum/captum/_utils/gradient.py | tbose20/D-Ref | eda6170a72838b89637df241dd5619e001f3afdb | [
"MIT"
] | 2 | 2022-03-24T13:41:51.000Z | 2022-03-29T02:32:56.000Z | captum/captum/_utils/gradient.py | tbose20/D-Ref | eda6170a72838b89637df241dd5619e001f3afdb | [
"MIT"
] | null | null | null | captum/captum/_utils/gradient.py | tbose20/D-Ref | eda6170a72838b89637df241dd5619e001f3afdb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import threading
import typing
import warnings
from collections import defaultdict
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
import torch
from captum._utils.common import (
_reduce_list,
_run_forward,
_sort_key_list,
_verify_select_neuron,
)
from ... | 39.730546 | 148 | 0.639646 | import threading
import typing
import warnings
from collections import defaultdict
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
import torch
from captum._utils.common import (
_reduce_list,
_run_forward,
_sort_key_list,
_verify_select_neuron,
)
from captum._utils.typing im... | true | true |
f70b35660098dbe1269746ca58b92936f76d8216 | 609 | py | Python | reit_project/reit-data/get-reit.py | SamMonk/data-bot | 2311870e993c5c2d1de617d31b3f7a6641da2a9b | [
"MIT"
] | null | null | null | reit_project/reit-data/get-reit.py | SamMonk/data-bot | 2311870e993c5c2d1de617d31b3f7a6641da2a9b | [
"MIT"
] | 5 | 2021-03-31T20:06:34.000Z | 2022-03-12T00:58:22.000Z | reit_project/reit-data/get-reit.py | SamMonk/data-bot | 2311870e993c5c2d1de617d31b3f7a6641da2a9b | [
"MIT"
] | null | null | null |
#https://finance.yahoo.com/screener/6039bb71-c189-4b62-ab6d-6dbd659495bb?count=200
import requests
from bs4 import BeautifulSoup
# import json
my_screener = requests.get(f'https://finance.yahoo.com/screener/6039bb71-c189-4b62-ab6d-6dbd659495bb?count=200')
#print(my_screener)
with open('code/reit-data/reits-screene... | 30.45 | 112 | 0.740558 |
import requests
from bs4 import BeautifulSoup
my_screener = requests.get(f'https://finance.yahoo.com/screener/6039bb71-c189-4b62-ab6d-6dbd659495bb?count=200')
with open('code/reit-data/reits-screener.html','r') as ticker_report:
ticker_table_string = ticker_report.read()
soup = BeautifulSoup(ticker_table_s... | true | true |
f70b3646b5d05db86a2415800f42bd74a54fb82f | 7,072 | py | Python | tests/test_users.py | AndreyAD1/forum | bae8bee6c45ca53b717c661a4dc624fec05aca35 | [
"MIT"
] | null | null | null | tests/test_users.py | AndreyAD1/forum | bae8bee6c45ca53b717c661a4dc624fec05aca35 | [
"MIT"
] | null | null | null | tests/test_users.py | AndreyAD1/forum | bae8bee6c45ca53b717c661a4dc624fec05aca35 | [
"MIT"
] | null | null | null | from collections import defaultdict
import logging
import random
from faker import Faker
import requests
logger = logging.getLogger(__file__)
def test_create_user():
fake = Faker()
user_info = {
'username': fake.first_name() + str(random.randint(1, 1000)),
'common_name': fake.name(),
... | 31.431111 | 75 | 0.610436 | from collections import defaultdict
import logging
import random
from faker import Faker
import requests
logger = logging.getLogger(__file__)
def test_create_user():
fake = Faker()
user_info = {
'username': fake.first_name() + str(random.randint(1, 1000)),
'common_name': fake.name(),
... | true | true |
f70b36ff11e294f9ba8cdf3e7c715b9161f3372a | 9,632 | py | Python | model_tools/activations/hooks.py | BonnerLab/model-tools | ac90617cd79bb70a308e34a1e834971498329fb0 | [
"MIT"
] | null | null | null | model_tools/activations/hooks.py | BonnerLab/model-tools | ac90617cd79bb70a308e34a1e834971498329fb0 | [
"MIT"
] | null | null | null | model_tools/activations/hooks.py | BonnerLab/model-tools | ac90617cd79bb70a308e34a1e834971498329fb0 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
import logging
import os
from typing import Optional, Union, Iterable, Dict
import h5py
import numpy as np
import torch
from PIL import Image
from tqdm import tqdm
from brainio.stimuli import StimulusSet
from model_tools.activations import ActivationsModel
from model_tools.activati... | 43.781818 | 120 | 0.653758 | from abc import ABC, abstractmethod
import logging
import os
from typing import Optional, Union, Iterable, Dict
import h5py
import numpy as np
import torch
from PIL import Image
from tqdm import tqdm
from brainio.stimuli import StimulusSet
from model_tools.activations import ActivationsModel
from model_tools.activati... | true | true |
f70b387bc0378d9c79b7989c448252e010565e1a | 3,287 | py | Python | combination_model_prediction.py | hrrsjeong/METEORE | 86f7949a0d65ccdabbbb41c44ea0a37fe4eb33c4 | [
"MIT"
] | 1 | 2020-07-16T09:59:58.000Z | 2020-07-16T09:59:58.000Z | combination_model_prediction.py | comprna/supermix | ba8e517c51dbfd3fea5130f297c480c4626c2ff0 | [
"MIT"
] | null | null | null | combination_model_prediction.py | comprna/supermix | ba8e517c51dbfd3fea5130f297c480c4626c2ff0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 9 18:03:39 2020
@author: akanksha
"""
import pandas as pd
import numpy as np
import joblib
from itertools import combinations
import sklearn
from functools import reduce
import argparse
import os
parser = argparse.ArgumentParser(description = 'Predict... | 42.141026 | 187 | 0.684211 |
import pandas as pd
import numpy as np
import joblib
from itertools import combinations
import sklearn
from functools import reduce
import argparse
import os
parser = argparse.ArgumentParser(description = 'Prediction from combined models for the reads.')
parser.add_argument('--methodsfile','-i', type =... | true | true |
f70b38a03ce07d299e033c0ceaa1d15797c754cb | 35,573 | py | Python | nextdl/extractor/nrk.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | 1 | 2021-12-19T13:55:20.000Z | 2021-12-19T13:55:20.000Z | nextdl/extractor/nrk.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | nextdl/extractor/nrk.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import itertools
import random
import re
from ..compat import compat_str
from ..utils import (ExtractorError, determine_ext, int_or_none,
parse_duration, str_or_none, try_get, url_or_none,
urljoin)
from .common import In... | 34.63778 | 131 | 0.47865 | from __future__ import unicode_literals
import itertools
import random
import re
from ..compat import compat_str
from ..utils import (ExtractorError, determine_ext, int_or_none,
parse_duration, str_or_none, try_get, url_or_none,
urljoin)
from .common import InfoExtractor
cl... | true | true |
f70b3938b82bcdff4d037cfe9f07cbf0b506cfc7 | 4,413 | py | Python | storm_analysis/diagnostics/sCMOS/configure.py | simone-codeluppi/storm-analysis | fa50fb7d670e9e4d712fa6fafb398963b39e209b | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/sCMOS/configure.py | simone-codeluppi/storm-analysis | fa50fb7d670e9e4d712fa6fafb398963b39e209b | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/sCMOS/configure.py | simone-codeluppi/storm-analysis | fa50fb7d670e9e4d712fa6fafb398963b39e209b | [
"CNRI-Python"
] | 1 | 2021-04-19T18:17:06.000Z | 2021-04-19T18:17:06.000Z | #!/usr/bin/env python
"""
Configure folder for sCMOS testing.
Hazen 09/17
"""
import numpy
import os
import storm_analysis
import storm_analysis.sa_library.parameters as parameters
import storm_analysis.simulator.emitters_on_grid as emittersOnGrid
import storm_analysis.simulator.emitters_uniform_random as emittersUn... | 34.476563 | 92 | 0.603898 | import numpy
import os
import storm_analysis
import storm_analysis.sa_library.parameters as parameters
import storm_analysis.simulator.emitters_on_grid as emittersOnGrid
import storm_analysis.simulator.emitters_uniform_random as emittersUniformRandom
import storm_analysis.diagnostics.sCMOS.settings as settings
def... | true | true |
f70b39f8922b10c9be5f4991136c6b870360b0d8 | 32,982 | py | Python | emulator.py | GuillaumeOrlando/Windows_Malware_Emulator | 6f49d424266d0126f359e4e4db66b690788f3b6a | [
"Apache-2.0"
] | 11 | 2021-03-16T18:41:29.000Z | 2022-01-11T15:39:19.000Z | emulator.py | GuillaumeOrlando/Windows_Malware_Emulator | 6f49d424266d0126f359e4e4db66b690788f3b6a | [
"Apache-2.0"
] | null | null | null | emulator.py | GuillaumeOrlando/Windows_Malware_Emulator | 6f49d424266d0126f359e4e4db66b690788f3b6a | [
"Apache-2.0"
] | null | null | null | from unicorn import *
from unicorn.x86_const import *
from capstone import *
from importlib import import_module
from emulation.syscall import clean_stack
import argparse
import emulation.syscall as winsyscall
import pefile
import struct
import sys
import ast
import os
#TODO: Deal with SEH structure
#TODO: Randomize T... | 43.001304 | 161 | 0.545479 | from unicorn import *
from unicorn.x86_const import *
from capstone import *
from importlib import import_module
from emulation.syscall import clean_stack
import argparse
import emulation.syscall as winsyscall
import pefile
import struct
import sys
import ast
import os
API_refs = 'winapi_9k.csv'
regs = ['eax', 'ebx',... | true | true |
f70b3a6a57e971fa38748f6fcdeb53521d3f0eda | 535 | py | Python | db_helpers.py | crisb0/final3011 | 8110b01edf17a4787d19ac8083ac4542381880b8 | [
"MIT"
] | null | null | null | db_helpers.py | crisb0/final3011 | 8110b01edf17a4787d19ac8083ac4542381880b8 | [
"MIT"
] | null | null | null | db_helpers.py | crisb0/final3011 | 8110b01edf17a4787d19ac8083ac4542381880b8 | [
"MIT"
] | 1 | 2018-09-25T03:52:04.000Z | 2018-09-25T03:52:04.000Z | import sqlite3
from app import app
from flask import g
DATABASE = 'db/trackpants.db'
def get_db():
db = getattr(g, '_database', None)
if db is None:
db = g._database = sqlite3.connect(DATABASE)
return db
@app.teardown_appcontext
def close_db(exception):
db = getattr(g, '_database', None)... | 21.4 | 52 | 0.639252 | import sqlite3
from app import app
from flask import g
DATABASE = 'db/trackpants.db'
def get_db():
db = getattr(g, '_database', None)
if db is None:
db = g._database = sqlite3.connect(DATABASE)
return db
@app.teardown_appcontext
def close_db(exception):
db = getattr(g, '_database', None)... | true | true |
f70b3c27a05fab17b36c2b9e4c733ddb6b814531 | 2,463 | py | Python | example/Python_Plot/Battery example/ee_0120_Y_consist.py | Mic-Tsai/Power-Consumption-Current-Sense-System-V22 | 7fe8348171efe53a2985a591ef7cf657bacc5fbd | [
"MIT"
] | 1 | 2020-08-19T02:30:42.000Z | 2020-08-19T02:30:42.000Z | example/Python_Plot/Battery example/ee_0120_Y_consist.py | Mic-Tsai/Power-Consumption-Current-Sense-System-V22 | 7fe8348171efe53a2985a591ef7cf657bacc5fbd | [
"MIT"
] | null | null | null | example/Python_Plot/Battery example/ee_0120_Y_consist.py | Mic-Tsai/Power-Consumption-Current-Sense-System-V22 | 7fe8348171efe53a2985a591ef7cf657bacc5fbd | [
"MIT"
] | null | null | null | import argparse, re, sys, os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
path = ''
flname = sys.argv[1]
try:
chartType = sys.argv[2]
except:
chartType = 'ch1_vload'
print('chartType:'+chartType)
fl = flname.split('/')
for i in fl[:-1]:
path = path+i+'/'
fw = open(flname, 'r')
rawdata = ... | 21.417391 | 75 | 0.624036 | import argparse, re, sys, os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
path = ''
flname = sys.argv[1]
try:
chartType = sys.argv[2]
except:
chartType = 'ch1_vload'
print('chartType:'+chartType)
fl = flname.split('/')
for i in fl[:-1]:
path = path+i+'/'
fw = open(flname, 'r')
rawdata = ... | true | true |
f70b3cd7485a9d19d3382154bde58d1928fe6a52 | 45,421 | py | Python | chainer/link.py | lazykyama/chainer | d4965bbf53af9e1b74b9b8a518f92c751f652a33 | [
"MIT"
] | 1 | 2019-09-04T15:15:43.000Z | 2019-09-04T15:15:43.000Z | chainer/link.py | dr4mohamed/chainer | 6fa28004889b260ae13484f17dc1ac68b25d52bb | [
"MIT"
] | null | null | null | chainer/link.py | dr4mohamed/chainer | 6fa28004889b260ae13484f17dc1ac68b25d52bb | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import collections
import contextlib
import copy
import typing as tp # NOQA
import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import device_resident
from chainer import initializers
from chainer imp... | 36.365893 | 119 | 0.595341 | from __future__ import absolute_import
import collections
import contextlib
import copy
import typing as tp import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import device_resident
from chainer import initializers
from chainer import lin... | true | true |
f70b3d490480e2c44304416517d3b896c717c71a | 5,994 | py | Python | application.py | jlind062/flippin_flask | 94c092ad49f9f7ab7995073d3382015d598e45f5 | [
"MIT"
] | 3 | 2019-06-22T19:00:10.000Z | 2019-06-23T18:33:46.000Z | application.py | sourenaKhanzadeh/flippin_flask | 94c092ad49f9f7ab7995073d3382015d598e45f5 | [
"MIT"
] | 1 | 2021-06-01T23:52:53.000Z | 2021-06-01T23:52:53.000Z | application.py | sourenaKhanzadeh/flippin_flask | 94c092ad49f9f7ab7995073d3382015d598e45f5 | [
"MIT"
] | 2 | 2019-06-22T19:00:19.000Z | 2019-06-22T20:33:19.000Z | from flask import Flask, render_template, request, flash, redirect, url_for, session
from flask_sqlalchemy import SQLAlchemy
from flask_mail import Message, Mail
from passlib.hash import sha256_crypt
from functools import wraps
import requests
import time
# create the flask app from config file and instantiate db
appl... | 37.698113 | 92 | 0.649983 | from flask import Flask, render_template, request, flash, redirect, url_for, session
from flask_sqlalchemy import SQLAlchemy
from flask_mail import Message, Mail
from passlib.hash import sha256_crypt
from functools import wraps
import requests
import time
application = Flask(__name__)
application.config.from_object('c... | true | true |
f70b3e78a726fa7daeafb49f4ec49e13ef4467c9 | 3,463 | py | Python | jina/parsers/helloworld.py | ryan-zheng-teki/jina | 042175fdb7e3ed8d9dd17233231beb2a8c2004bf | [
"Apache-2.0"
] | null | null | null | jina/parsers/helloworld.py | ryan-zheng-teki/jina | 042175fdb7e3ed8d9dd17233231beb2a8c2004bf | [
"Apache-2.0"
] | null | null | null | jina/parsers/helloworld.py | ryan-zheng-teki/jina | 042175fdb7e3ed8d9dd17233231beb2a8c2004bf | [
"Apache-2.0"
] | null | null | null | from pkg_resources import resource_filename
from .base import set_base_parser
from .helper import add_arg_group
from ..helper import get_random_identity
def set_hw_parser(parser=None):
if not parser:
parser = set_base_parser()
gp = add_arg_group(parser, title='General')
gp.add_argument('--workdi... | 54.109375 | 116 | 0.597748 | from pkg_resources import resource_filename
from .base import set_base_parser
from .helper import add_arg_group
from ..helper import get_random_identity
def set_hw_parser(parser=None):
if not parser:
parser = set_base_parser()
gp = add_arg_group(parser, title='General')
gp.add_argument('--workdi... | true | true |
f70b3f7012f084ba3f391beabb56936491ed1b59 | 3,833 | py | Python | install/app_store/tk-houdini-mantranode/v0.3.0/app.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | 4 | 2019-01-11T03:41:28.000Z | 2019-09-12T06:57:17.000Z | bundle_cache/app_store/tk-houdini-mantranode/v0.3.1/app.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | null | null | null | bundle_cache/app_store/tk-houdini-mantranode/v0.3.1/app.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | 2 | 2019-01-10T05:00:18.000Z | 2020-02-15T16:32:56.000Z | # Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... | 33.920354 | 78 | 0.663449 |
import sgtk
class TkMantraNodeApp(sgtk.platform.Application):
def init_app(self):
tk_houdini_mantra = self.import_module("tk_houdini_mantranode")
self.handler = tk_houdini_mantra.TkMantraNodeHandler(self)
def convert_to_regular_mantra_nodes(self):
self.log_debug(
"Con... | true | true |
f70b419f55fd62b2aff2ff85eee6f57f67a7d0d8 | 2,647 | py | Python | cases/1d/graphCaseValidation.py | andytorrestb/rarefiedPlume | c09234c701c395d16519d8a361eae17540711530 | [
"MIT"
] | null | null | null | cases/1d/graphCaseValidation.py | andytorrestb/rarefiedPlume | c09234c701c395d16519d8a361eae17540711530 | [
"MIT"
] | null | null | null | cases/1d/graphCaseValidation.py | andytorrestb/rarefiedPlume | c09234c701c395d16519d8a361eae17540711530 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
# Find path for cases
curr_dir_path = os.path.dirname(os.path.realpath(__file__))
# print(curr_dir_path)
# cases = os.listdir(curr_dir_path + '/Cases')
# pop = cases.index('baseCase')
# cases.pop(pop)
# Label graph with bold characters
f... | 27.010204 | 87 | 0.649792 | import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
curr_dir_path = os.path.dirname(os.path.realpath(__file__))
font_axis_publish = {
'color': 'black',
'weight': 'bold',
'size': 22,
}
digi_n = pd.read_csv(
curr_dir_path + '/n_nstar_radius.dat',
header = 0... | true | true |
f70b420d90436b97dbaad27536f9a5d01d87e845 | 842 | py | Python | github/content/licenserule.py | ShineyDev/github | fbc7a3f66af34350c754e2d8b278ef419d0296b9 | [
"Apache-2.0"
] | 2 | 2021-04-24T10:54:12.000Z | 2021-07-08T08:26:58.000Z | github/content/licenserule.py | ShineyDev/github | fbc7a3f66af34350c754e2d8b278ef419d0296b9 | [
"Apache-2.0"
] | null | null | null | github/content/licenserule.py | ShineyDev/github | fbc7a3f66af34350c754e2d8b278ef419d0296b9 | [
"Apache-2.0"
] | 4 | 2019-07-09T23:23:36.000Z | 2022-03-30T13:53:15.000Z | from github.interfaces import Type
class LicenseRule(Type):
"""
Represents a license rule.
"""
__slots__ = ()
_repr_fields = [
"key",
]
_graphql_fields = [
"description",
"key",
"label",
]
@property
def description(self):
"""
... | 15.309091 | 53 | 0.509501 | from github.interfaces import Type
class LicenseRule(Type):
__slots__ = ()
_repr_fields = [
"key",
]
_graphql_fields = [
"description",
"key",
"label",
]
@property
def description(self):
return self._get_field("description")
@property
d... | true | true |
f70b436846b47c3c69212de540878dd80838e8d3 | 2,621 | py | Python | Lib/site-packages/pylint/extensions/check_elif.py | punithmadaiahkumar/try-django | 39680a7583122bdd722789f92400edae67c6251d | [
"MIT"
] | 2 | 2022-01-06T23:31:00.000Z | 2022-01-06T23:35:49.000Z | Lib/site-packages/pylint/extensions/check_elif.py | punithmadaiahkumar/try-django | 39680a7583122bdd722789f92400edae67c6251d | [
"MIT"
] | null | null | null | Lib/site-packages/pylint/extensions/check_elif.py | punithmadaiahkumar/try-django | 39680a7583122bdd722789f92400edae67c6251d | [
"MIT"
] | null | null | null | # Copyright (c) 2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2016-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Glenn Matthews <glmatthe@cisco.com>
# Copyright (c) 2018 Ville Skyttä <ville.skytta@iki.fi>
# Copyright (c) 2019-2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
#... | 36.402778 | 87 | 0.662343 |
from astroid import nodes
from pylint.checkers import BaseTokenChecker
from pylint.checkers.utils import check_messages
from pylint.interfaces import HIGH, IAstroidChecker, ITokenChecker
class ElseifUsedChecker(BaseTokenChecker):
__implements__ = (ITokenChecker, IAstroidChecker)
name = "else_if_used"
... | true | true |
f70b4427b05485de045681e5ad5ce916276873c7 | 5,002 | py | Python | pretrain.py | nakashima-kodai/FractalDB_Pretrained_ViT_PyTorch | 5d1df4023f05f5a8ff7e8a8810bf95119a0eeb96 | [
"MIT"
] | 12 | 2021-05-22T12:13:32.000Z | 2022-01-27T03:13:48.000Z | pretrain.py | nakashima-kodai/FractalDB_Pretrained_ViT_PyTorch | 5d1df4023f05f5a8ff7e8a8810bf95119a0eeb96 | [
"MIT"
] | null | null | null | pretrain.py | nakashima-kodai/FractalDB_Pretrained_ViT_PyTorch | 5d1df4023f05f5a8ff7e8a8810bf95119a0eeb96 | [
"MIT"
] | null | null | null | import os, sys
import math
import hydra
import torch
import timm
from hydra.utils import instantiate
from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
from timm.utils import NativeScaler
import models
from data import create_dataloader
from utils import MetricLogger, SmoothedValue
from utils im... | 35.728571 | 101 | 0.644542 | import os, sys
import math
import hydra
import torch
import timm
from hydra.utils import instantiate
from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
from timm.utils import NativeScaler
import models
from data import create_dataloader
from utils import MetricLogger, SmoothedValue
from utils im... | true | true |
f70b445e1cc3bd08d98868de9c00c440790bf47c | 5,633 | py | Python | deep_autoviml/preprocessing/preprocessing_images.py | chekoduadarsh/deep_autoviml | 157fbdc2611dc0fbaee5fc4ebebe3e7c1eeb9b52 | [
"Apache-2.0"
] | 1 | 2021-12-15T17:11:24.000Z | 2021-12-15T17:11:24.000Z | deep_autoviml/preprocessing/preprocessing_images.py | chekoduadarsh/deep_autoviml | 157fbdc2611dc0fbaee5fc4ebebe3e7c1eeb9b52 | [
"Apache-2.0"
] | null | null | null | deep_autoviml/preprocessing/preprocessing_images.py | chekoduadarsh/deep_autoviml | 157fbdc2611dc0fbaee5fc4ebebe3e7c1eeb9b52 | [
"Apache-2.0"
] | null | null | null | #Copyright 2021 Google LLC
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing,... | 48.145299 | 126 | 0.648322 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tempfile
import pdb
import copy
import warnings
warnings.filterwarnings(action='ignore')
import functools
from itertools import combinations
from collections import defaultdict
np.set_printoptions(precision=3, suppress=True)
... | true | true |
f70b453634eac4dbf2a64b4b70be55fdf1b7ac80 | 3,993 | py | Python | evaluation/scripts/textflint_utils/utils.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 15 | 2021-09-24T00:46:04.000Z | 2022-03-16T13:24:56.000Z | evaluation/scripts/textflint_utils/utils.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 98 | 2021-09-22T12:33:21.000Z | 2022-03-21T22:23:52.000Z | evaluation/scripts/textflint_utils/utils.py | zpapakipos/dynabench-1 | 95884b4e29c57263dc1a85909be979c084d5fac3 | [
"MIT"
] | 12 | 2021-09-25T05:08:18.000Z | 2022-02-28T21:02:20.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Convert data to textflint format and run transform functions in textflint
import glob
import json
import os
from textflint import Engine
CO... | 32.201613 | 88 | 0.60556 |
import glob
import json
import os
from textflint import Engine
CONFIG_PATH = "textflint_utils/configs"
TRANSFORM_FIELDS = {
"nli": {"context": "premise", "hypothesis": "hypothesis"},
"sentiment": {"statement": "x"},
"hs": {"statement": "x"},
"qa": {"context": "context", "question": "question"},
}
L... | true | true |
f70b468eed83845185b750bee867ad6d6a0b97d5 | 679 | py | Python | smsarch.py | archzets/smsarch | b4fc69890dfb84e4e8636ee65ad68128a62a0da9 | [
"BSL-1.0"
] | null | null | null | smsarch.py | archzets/smsarch | b4fc69890dfb84e4e8636ee65ad68128a62a0da9 | [
"BSL-1.0"
] | null | null | null | smsarch.py | archzets/smsarch | b4fc69890dfb84e4e8636ee65ad68128a62a0da9 | [
"BSL-1.0"
] | null | null | null | import requests
import pyfiglet
ascii_banner = pyfiglet.figlet_format("SMSARCH")
print(ascii_banner)
import requests
while True:
kime = input("kim:")
mesaj = input("mesaj:")
if " " in kime or mesaj == "":
break
resp = requests.post('https://textbelt.com/text', {
'phone': '{}'.format(kime... | 28.291667 | 99 | 0.537555 | import requests
import pyfiglet
ascii_banner = pyfiglet.figlet_format("SMSARCH")
print(ascii_banner)
import requests
while True:
kime = input("kim:")
mesaj = input("mesaj:")
if " " in kime or mesaj == "":
break
resp = requests.post('https://textbelt.com/text', {
'phone': '{}'.format(kime... | true | true |
f70b4712d4642d8fba04922d1c1c7b2949c947b8 | 27,320 | py | Python | src/pipx/main.py | gotmax23/pipx | adb078cb9456c56da5f721da73c22df357a60bda | [
"MIT"
] | 1,244 | 2021-05-27T09:25:58.000Z | 2022-03-31T19:03:41.000Z | src/pipx/main.py | gotmax23/pipx | adb078cb9456c56da5f721da73c22df357a60bda | [
"MIT"
] | 138 | 2021-05-27T09:47:41.000Z | 2022-03-30T01:04:02.000Z | src/pipx/main.py | gotmax23/pipx | adb078cb9456c56da5f721da73c22df357a60bda | [
"MIT"
] | 97 | 2021-05-28T17:48:09.000Z | 2022-03-30T00:31:32.000Z | # PYTHON_ARGCOMPLETE_OK
"""The command line interface to pipx"""
import argparse
import logging
import logging.config
import os
import re
import shlex
import sys
import textwrap
import time
import urllib.parse
from pathlib import Path
from typing import Any, Callable, Dict, List
import argcomplete # type: ignore
fr... | 34.321608 | 121 | 0.636054 |
import argparse
import logging
import logging.config
import os
import re
import shlex
import sys
import textwrap
import time
import urllib.parse
from pathlib import Path
from typing import Any, Callable, Dict, List
import argcomplete from packaging.requirements import InvalidRequirement, Requirement
from packaging.... | true | true |
f70b47643839b003e1a33b6eff6fc4f5f1de1581 | 410 | py | Python | quadpy/e3r/tools.py | gdmcbain/quadpy | c083d500027d7c1b2187ae06ff2b7fbdd360ccc7 | [
"MIT"
] | 1 | 2019-01-02T19:04:42.000Z | 2019-01-02T19:04:42.000Z | quadpy/e3r/tools.py | gdmcbain/quadpy | c083d500027d7c1b2187ae06ff2b7fbdd360ccc7 | [
"MIT"
] | null | null | null | quadpy/e3r/tools.py | gdmcbain/quadpy | c083d500027d7c1b2187ae06ff2b7fbdd360ccc7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
import numpy
from .. import helpers
def integrate(f, rule, dot=numpy.dot):
flt = numpy.vectorize(float)
return dot(f(flt(rule.points).T), flt(rule.weights))
def show(scheme, backend="mpl"):
"""Displays scheme for E_3^r quadrature.
"""
helpers.backend_to_function[backen... | 20.5 | 68 | 0.641463 | import numpy
from .. import helpers
def integrate(f, rule, dot=numpy.dot):
flt = numpy.vectorize(float)
return dot(f(flt(rule.points).T), flt(rule.weights))
def show(scheme, backend="mpl"):
helpers.backend_to_function[backend](
scheme.points, scheme.weights, volume=8 * numpy.pi, edges=[]
)
... | true | true |
f70b478d5085a5ad29d7c5f1433e9a5dcace1aa8 | 488 | py | Python | bark/runtime/scenario/scenario_generation/config_readers/__init__.py | GAIL-4-BARK/bark | 1cfda9ba6e9ec5318fbf01af6b67c242081b516e | [
"MIT"
] | null | null | null | bark/runtime/scenario/scenario_generation/config_readers/__init__.py | GAIL-4-BARK/bark | 1cfda9ba6e9ec5318fbf01af6b67c242081b516e | [
"MIT"
] | null | null | null | bark/runtime/scenario/scenario_generation/config_readers/__init__.py | GAIL-4-BARK/bark | 1cfda9ba6e9ec5318fbf01af6b67c242081b516e | [
"MIT"
] | 1 | 2020-08-12T17:09:05.000Z | 2020-08-12T17:09:05.000Z | # Copyright (c) 2020 Julian Bernhard, Klemens Esterle, Patrick Hart and
# Tobias Kessler
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
from .agent_state_geometry_config_readers import *
from .behavior_model_config_readers import *
from .controlle... | 40.666667 | 71 | 0.817623 |
from .agent_state_geometry_config_readers import *
from .behavior_model_config_readers import *
from .controlled_agents_config_readers import *
from .dynamic_model_config_readers import *
from .execution_model_config_readers import *
from .goal_definition_config_readers import * | true | true |
f70b487dbf13fd67d8c1b8771e80901c74c097de | 2,633 | py | Python | scripts/clean.py | aman-roy/oppia | 0e7066829b59bf6ce4b15c4723fe0398721cfd1a | [
"Apache-2.0"
] | 2 | 2019-12-02T18:56:49.000Z | 2020-03-14T17:14:15.000Z | scripts/clean.py | aman-roy/oppia | 0e7066829b59bf6ce4b15c4723fe0398721cfd1a | [
"Apache-2.0"
] | 2 | 2019-09-11T23:11:48.000Z | 2019-11-29T06:04:52.000Z | scripts/clean.py | aman-roy/oppia | 0e7066829b59bf6ce4b15c4723fe0398721cfd1a | [
"Apache-2.0"
] | 2 | 2019-12-02T18:56:56.000Z | 2020-03-16T08:03:45.000Z | # Copyright 2019 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 31.345238 | 79 | 0.734523 |
from __future__ import absolute_import from __future__ import unicode_literals
import argparse
import os
import shutil
import python_utils
CURR_DIR = os.path.abspath(os.getcwd())
OPPIA_TOOLS_DIR = os.path.join(CURR_DIR, '..', 'oppia_tools')
_PARSER = argparse.ArgumentParser(description="""
Deletes temporary and... | true | true |
f70b4945227d811eedda76780bd668eab187029e | 2,622 | py | Python | model_measuring/kamal/core/engine/events.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-01-11T07:14:37.000Z | 2022-01-11T07:14:37.000Z | model_measuring/kamal/core/engine/events.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-04T07:19:43.000Z | 2022-03-04T07:19:43.000Z | model_measuring/kamal/core/engine/events.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-20T13:09:14.000Z | 2022-03-20T13:09:14.000Z | """
Copyright 2020 Tianshu AI Platform. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law ... | 28.5 | 79 | 0.637681 |
from typing import Callable, Optional
from enum import Enum
class Event(object):
def __init__(self, value: str, event_trigger: Optional[Callable]=None ):
if event_trigger is None:
event_trigger = Event.default_trigger
self._trigger = event_trigger
self._name_ = self._value_ = ... | true | true |
f70b494729d59f0ef0996b3eb8e1b49262383183 | 773 | py | Python | scripts/run_pipeline.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | scripts/run_pipeline.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | scripts/run_pipeline.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import json
import os
import sys
import uuid
from alphad3m.automl import AutoML
if __name__ == '__main__':
if len(sys.argv) != 3:
sys.stderr.write('Usage: %s <config> <pipeline_uuid>\n' % sys.argv[0])
sys.exit(1)
with open(sys.argv[1]) as config_file:
config = ... | 28.62963 | 84 | 0.615783 | import json
import os
import sys
import uuid
from alphad3m.automl import AutoML
if __name__ == '__main__':
if len(sys.argv) != 3:
sys.stderr.write('Usage: %s <config> <pipeline_uuid>\n' % sys.argv[0])
sys.exit(1)
with open(sys.argv[1]) as config_file:
config = json.load(config_file)
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.