hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
84a625573c38842b6185438bd046b74e11c4135b | 3,214 | py | Python | setup.py | gsjung0419/torchani | d95ab5dfeee4a25b5286d4b7f3446d2aecb36be3 | [
"MIT"
] | null | null | null | setup.py | gsjung0419/torchani | d95ab5dfeee4a25b5286d4b7f3446d2aecb36be3 | [
"MIT"
] | 11 | 2020-06-25T20:31:12.000Z | 2020-11-05T23:44:52.000Z | setup.py | IgnacioJPickering/torchani | 8776296d18b0ffc735f147578ece299458a041e0 | [
"MIT"
] | null | null | null | import os
import glob
import subprocess
from setuptools import setup, find_packages
from distutils import log
import sys
BUILD_CUAEV = '--cuaev' in sys.argv
if BUILD_CUAEV:
sys.argv.remove('--cuaev')
if not BUILD_CUAEV:
log.warn("Will not install cuaev") # type: ignore
with open("README.md", "r") as fh:
... | 29.759259 | 94 | 0.624767 | import os
import glob
import subprocess
from setuptools import setup, find_packages
from distutils import log
import sys
BUILD_CUAEV = '--cuaev' in sys.argv
if BUILD_CUAEV:
sys.argv.remove('--cuaev')
if not BUILD_CUAEV:
log.warn("Will not install cuaev") # type: ignore
with open("README.md", "r") as fh:
... | 2,224 | 0 | 69 |
8300e6d0cf1ff07bec5a40f1e064322894a3bf78 | 896 | py | Python | utils/compile-proto.py | Alexey-N-Chernyshov/reblockstorer | 4ca47e39322ba11d6c32455448d3d183445a156e | [
"MIT"
] | 2 | 2019-06-17T14:54:54.000Z | 2019-12-03T06:42:03.000Z | utils/compile-proto.py | Alexey-N-Chernyshov/reblockstorer | 4ca47e39322ba11d6c32455448d3d183445a156e | [
"MIT"
] | null | null | null | utils/compile-proto.py | Alexey-N-Chernyshov/reblockstorer | 4ca47e39322ba11d6c32455448d3d183445a156e | [
"MIT"
] | 3 | 2019-06-21T07:30:31.000Z | 2019-10-30T05:56:41.000Z | #!/usr/bin/env python3
from six.moves import getoutput
import os.path
from os import chdir
directory = os.path.dirname(os.path.abspath(__file__))
chdir(directory)
print('Working directory set to {}'.format(directory))
proto_path = os.path.join('..', 'schema')
python_out = os.path.join('..', 'reblockstorer', 'proto')... | 34.461538 | 76 | 0.666295 | #!/usr/bin/env python3
from six.moves import getoutput
import os.path
from os import chdir
directory = os.path.dirname(os.path.abspath(__file__))
chdir(directory)
print('Working directory set to {}'.format(directory))
proto_path = os.path.join('..', 'schema')
python_out = os.path.join('..', 'reblockstorer', 'proto')... | 0 | 0 | 0 |
cd5a4b0f486dd82e679fbbb52f347efba49a6362 | 4,017 | py | Python | argue/helpers.py | kennethreitz-archive/argue | d936d63c16b8afcfabfcc1bcf41938cc237f40bb | [
"MIT"
] | 3 | 2015-04-23T03:23:30.000Z | 2016-07-17T18:06:24.000Z | argue/helpers.py | kennethreitz-archive/argue | d936d63c16b8afcfabfcc1bcf41938cc237f40bb | [
"MIT"
] | null | null | null | argue/helpers.py | kennethreitz-archive/argue | d936d63c16b8afcfabfcc1bcf41938cc237f40bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import inspect
import getopt
import traceback
from exceptions import *
write = sys.stdout.write
err = sys.stderr.write
def trim(docstring):
"""Intelligently undent given docstring."""
if not docstring:
return ''
# Convert tabs to spaces (following the normal Python rules)
... | 28.489362 | 75 | 0.593976 | # -*- coding: utf-8 -*-
import sys
import inspect
import getopt
import traceback
from exceptions import *
write = sys.stdout.write
err = sys.stderr.write
def trim(docstring):
"""Intelligently undent given docstring."""
if not docstring:
return ''
# Convert tabs to spaces (following the normal Python rules)
... | 2,046 | 0 | 164 |
396a9a31bc1d1babea2e767718cab81c18022118 | 274 | py | Python | Part 2/Week_4_7/Exer 2 - Encontrando impares.py | Arielcarv/Intro-Ciencia-da-Computacao-USP | 03d69b9e0f3fa5fca053d0fc406aa1a584d33de1 | [
"MIT"
] | null | null | null | Part 2/Week_4_7/Exer 2 - Encontrando impares.py | Arielcarv/Intro-Ciencia-da-Computacao-USP | 03d69b9e0f3fa5fca053d0fc406aa1a584d33de1 | [
"MIT"
] | null | null | null | Part 2/Week_4_7/Exer 2 - Encontrando impares.py | Arielcarv/Intro-Ciencia-da-Computacao-USP | 03d69b9e0f3fa5fca053d0fc406aa1a584d33de1 | [
"MIT"
] | null | null | null | # a = [-10, -2, 0, 5, 66, 77, 99, 102, 239, 567, 875, 934]
# print(encontra_impares(a)) | 24.909091 | 58 | 0.587591 | # a = [-10, -2, 0, 5, 66, 77, 99, 102, 239, 567, 875, 934]
def encontra_impares(lista):
if not lista:
return[]
if lista[0] % 2 == 1:
return[lista[0]] + encontra_impares(lista[1:])
return encontra_impares(lista[1:])
# print(encontra_impares(a)) | 162 | 0 | 23 |
23027e9eed696d721e75648f6de079cc3952f156 | 853 | py | Python | me/storage/mongodb/collections/Transaction.py | me-env/me. | 2466399e7e16364782cfa7c97a6877026910fc24 | [
"BSD-3-Clause"
] | 2 | 2022-02-19T12:28:47.000Z | 2022-02-21T13:57:34.000Z | me/storage/mongodb/collections/Transaction.py | me-env/me. | 2466399e7e16364782cfa7c97a6877026910fc24 | [
"BSD-3-Clause"
] | null | null | null | me/storage/mongodb/collections/Transaction.py | me-env/me. | 2466399e7e16364782cfa7c97a6877026910fc24 | [
"BSD-3-Clause"
] | null | null | null | from .Collection import Collection
from me.storage.data_config import DataType
from datetime import datetime
from me.logger import MeLogger, DEBUG
| 35.541667 | 100 | 0.667057 | from .Collection import Collection
from me.storage.data_config import DataType
from datetime import datetime
from me.logger import MeLogger, DEBUG
class Transaction(Collection):
def __init__(self, db, reset=False):
self.log = MeLogger(name=__name__)
super().__init__(db, DataType.TXs.value, self.lo... | 592 | 9 | 103 |
a4c99b84e9efe504cb9a3bd6dff93b11f1910fe2 | 954 | py | Python | snoop/management/commands/walkocr.py | hoover/snoop | bd49b081418a8a01a1e469ab17759a4c5b20d850 | [
"MIT"
] | 5 | 2017-01-03T00:52:03.000Z | 2019-10-27T03:32:35.000Z | snoop/management/commands/walkocr.py | hoover/snoop | bd49b081418a8a01a1e469ab17759a4c5b20d850 | [
"MIT"
] | 25 | 2016-08-21T11:26:44.000Z | 2018-03-13T12:19:20.000Z | snoop/management/commands/walkocr.py | hoover/snoop | bd49b081418a8a01a1e469ab17759a4c5b20d850 | [
"MIT"
] | 6 | 2016-09-27T13:03:45.000Z | 2019-10-27T03:32:30.000Z | import sys
from django.core.management.base import BaseCommand
from ... import models
from ...ocr import walk
| 30.774194 | 88 | 0.604822 | import sys
from django.core.management.base import BaseCommand
from ... import models
from ...ocr import walk
class Command(BaseCommand):
help = "Ingest OCRed files"
def add_arguments(self, parser):
parser.add_argument(
'collection_slug',
help="The slug of the collection"
... | 728 | 93 | 23 |
48d744dd4582baa4ff136fa30d44e02897214027 | 623 | py | Python | cot.py | RuanGOA/shellQuot | 255c66abd2df1b1b45ed9fdbd4b499c937be7ece | [
"MIT"
] | null | null | null | cot.py | RuanGOA/shellQuot | 255c66abd2df1b1b45ed9fdbd4b499c937be7ece | [
"MIT"
] | null | null | null | cot.py | RuanGOA/shellQuot | 255c66abd2df1b1b45ed9fdbd4b499c937be7ece | [
"MIT"
] | null | null | null | import requests as req
import sys
import json
request = req.get('https://economia.awesomeapi.com.br/json/all')
cotacoes = json.loads(request.text)
consultas = ["USD", "ARS", "EUR", "BTC"]
if(len(sys.argv) > 1):
consultas = sys.argv[1:]
print("1 BRL ==")
exibeCotacoes(consultas)
| 24.92 | 87 | 0.642055 | import requests as req
import sys
import json
request = req.get('https://economia.awesomeapi.com.br/json/all')
cotacoes = json.loads(request.text)
def exibeCotacoes(querys):
global cotacoes
keySet = cotacoes.keys()
for query in querys:
if(query in keySet):
preco = (float(cotacoes[query]['hig... | 315 | 0 | 23 |
5403d2690b90f53934ea0f73498e3f695dda07c9 | 3,461 | py | Python | src/api.py | UncleGoogle/galaxy-integration-osu | e18ce670bceb37dccff48c5bb70917dd205dffe8 | [
"MIT"
] | 15 | 2020-05-04T19:40:03.000Z | 2022-01-28T15:33:30.000Z | src/api.py | UncleGoogle/galaxy-integration-osu | e18ce670bceb37dccff48c5bb70917dd205dffe8 | [
"MIT"
] | 8 | 2020-05-02T20:14:42.000Z | 2022-01-17T11:16:31.000Z | src/api.py | UncleGoogle/galaxy-integration-osu | e18ce670bceb37dccff48c5bb70917dd205dffe8 | [
"MIT"
] | null | null | null | import logging
import urllib
import json
import base64
import typing as t
from galaxy.http import create_client_session, handle_exception
from galaxy.api.errors import AccessDenied, AuthenticationRequired
logger = logging.getLogger(__name__)
| 32.961905 | 94 | 0.639122 | import logging
import urllib
import json
import base64
import typing as t
from galaxy.http import create_client_session, handle_exception
from galaxy.api.errors import AccessDenied, AuthenticationRequired
logger = logging.getLogger(__name__)
class OAuthClient:
URL = 'https://unclegoogle.pythonanywhere.com/'
... | 2,337 | 727 | 149 |
fcc269c2c542432a45af1824239b195636264d11 | 158 | py | Python | work/apps.py | allink/allink-apps | 101a9e2e0129d932970e0ae89f790d2033a7c805 | [
"BSD-3-Clause"
] | 1 | 2017-03-13T08:49:49.000Z | 2017-03-13T08:49:49.000Z | work/apps.py | allink/allink-apps | 101a9e2e0129d932970e0ae89f790d2033a7c805 | [
"BSD-3-Clause"
] | null | null | null | work/apps.py | allink/allink-apps | 101a9e2e0129d932970e0ae89f790d2033a7c805 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.apps import AppConfig
| 19.75 | 34 | 0.696203 | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class AllinkWorkConfig(AppConfig):
name = 'allink_apps.work'
verbose_name = "Allink Work"
| 0 | 76 | 23 |
1ad1ba0261ce77b4901455f2ff9168f1076b225b | 2,669 | py | Python | Python/website/available.py | saneravi/ML_Stuff | 74e1ed7ba9f4dccb555792315a14ba6071150304 | [
"MIT"
] | 209 | 2015-01-02T03:47:12.000Z | 2022-03-06T16:54:47.000Z | Python/website/available.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 3 | 2015-12-06T14:40:34.000Z | 2021-03-22T17:40:24.000Z | Python/website/available.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 114 | 2015-01-31T08:37:10.000Z | 2022-02-23T04:42:28.000Z | import progressbar
import pythonwhois
def is_registered(site):
"""Check if a domain has an WHOIS record."""
try:
details = pythonwhois.get_whois(site)
except pythonwhois.shared.WhoisException as e:
print(f"Exception for {site}")
print(e)
return False
return not details[... | 25.663462 | 82 | 0.556763 | import progressbar
import pythonwhois
def is_registered(site):
"""Check if a domain has an WHOIS record."""
try:
details = pythonwhois.get_whois(site)
except pythonwhois.shared.WhoisException as e:
print(f"Exception for {site}")
print(e)
return False
return not details[... | 1,088 | 0 | 46 |
d48ffab9531a297072cbd4ff76bdd5719f069206 | 15,887 | py | Python | zoom/tools.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | null | null | null | zoom/tools.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | null | null | null | zoom/tools.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | 1 | 2019-02-06T16:10:56.000Z | 2019-02-06T16:10:56.000Z | """
zoom.tools
"""
import datetime
import logging
import os
from markdown import Markdown
from zoom.response import RedirectResponse
import zoom.helpers
from zoom.helpers import abs_url_for, url_for_page, url_for
from zoom.utils import trim, dedup
from zoom.render import apply_helpers
one_day = datetime.timedelt... | 26.087028 | 81 | 0.586454 | """
zoom.tools
"""
import datetime
import logging
import os
from markdown import Markdown
from zoom.response import RedirectResponse
import zoom.helpers
from zoom.helpers import abs_url_for, url_for_page, url_for
from zoom.utils import trim, dedup
from zoom.render import apply_helpers
one_day = datetime.timedelt... | 2,232 | 425 | 130 |
52f5ac4f40e2e21467d07470d5b4acddc43f73ab | 7,206 | py | Python | SlackBot.py | KeitHLeE94/Fresh_SSAFY | ba28b7f565798f87dd0635f646a088f6bcd92b8b | [
"MIT"
] | null | null | null | SlackBot.py | KeitHLeE94/Fresh_SSAFY | ba28b7f565798f87dd0635f646a088f6bcd92b8b | [
"MIT"
] | null | null | null | SlackBot.py | KeitHLeE94/Fresh_SSAFY | ba28b7f565798f87dd0635f646a088f6bcd92b8b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import os
import requests
import urllib.request
import time
import re
from bs4 import BeautifulSoup
from slackclient import SlackClient
from flask import Flask, request, make_response, render_template, jsonify
from selenium import webdriver
# 바꼈지롱
app = Flask(__name__)
app.config['... | 30.927039 | 120 | 0.620594 | # -*- coding: utf-8 -*-
import json
import os
import requests
import urllib.request
import time
import re
from bs4 import BeautifulSoup
from slackclient import SlackClient
from flask import Flask, request, make_response, render_template, jsonify
from selenium import webdriver
# 바꼈지롱
app = Flask(__name__)
app.config['... | 6,384 | 0 | 222 |
da9bb511136f1f7b075fc6f9636408c96b13d22e | 6,336 | py | Python | src/discolight/writers/annotation/coco.py | datature/discolight | ad29e75b472cf892a087d23cc9436f47f1b15441 | [
"MIT"
] | 27 | 2020-07-23T08:09:25.000Z | 2022-03-01T08:24:43.000Z | src/discolight/writers/annotation/coco.py | ghnreigns/discolight | 71ee176e0e58489867f21ddfcf8cce338631129c | [
"MIT"
] | 7 | 2020-08-05T07:26:55.000Z | 2020-12-31T04:20:40.000Z | src/discolight/writers/annotation/coco.py | ghnreigns/discolight | 71ee176e0e58489867f21ddfcf8cce338631129c | [
"MIT"
] | 6 | 2020-07-27T04:30:01.000Z | 2020-08-13T02:39:25.000Z | """A COCO annotation writer."""
import datetime
import json
from discolight.params.params import Params
from .types import AnnotationWriter
class COCO(AnnotationWriter):
"""A COCO annotation writer."""
def __init__(self, annotations_file):
"""Construct a COCO annotation writer."""
self.annot... | 30.171429 | 79 | 0.525568 | """A COCO annotation writer."""
import datetime
import json
from discolight.params.params import Params
from .types import AnnotationWriter
class COCO(AnnotationWriter):
"""A COCO annotation writer."""
def __init__(self, annotations_file):
"""Construct a COCO annotation writer."""
self.annot... | 0 | 0 | 0 |
a7680455f32028face2945d19acebab84b4be873 | 1,003 | py | Python | game/authentication/websocket_authentication.py | dimadk24/english-fight-api | 506a3eb2cb4cb91203b1e023b5248c27975df075 | [
"MIT"
] | null | null | null | game/authentication/websocket_authentication.py | dimadk24/english-fight-api | 506a3eb2cb4cb91203b1e023b5248c27975df075 | [
"MIT"
] | null | null | null | game/authentication/websocket_authentication.py | dimadk24/english-fight-api | 506a3eb2cb4cb91203b1e023b5248c27975df075 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.utils.module_loading import import_string
from rest_framework.exceptions import AuthenticationFailed
from game.authentication.base_websocket_authentication import (
AbstractWebsocketAuthentication,
)
from game.models import AppUser
def authenticate_websocket(auth_head... | 35.821429 | 69 | 0.75673 | from django.conf import settings
from django.utils.module_loading import import_string
from rest_framework.exceptions import AuthenticationFailed
from game.authentication.base_websocket_authentication import (
AbstractWebsocketAuthentication,
)
from game.models import AppUser
def authenticate_websocket(auth_head... | 0 | 0 | 0 |
0b870a848cb319128582b27118ad6c272c59b5dd | 261 | py | Python | exercises/es/solution_03_03.py | mariacamilagl/spacy-course | de9fcdfcbc75e6a8864e49f2f75ab1536969cb70 | [
"MIT"
] | null | null | null | exercises/es/solution_03_03.py | mariacamilagl/spacy-course | de9fcdfcbc75e6a8864e49f2f75ab1536969cb70 | [
"MIT"
] | null | null | null | exercises/es/solution_03_03.py | mariacamilagl/spacy-course | de9fcdfcbc75e6a8864e49f2f75ab1536969cb70 | [
"MIT"
] | 1 | 2020-06-08T13:26:06.000Z | 2020-06-08T13:26:06.000Z | import spacy
# Carga el modelo en_core_web_sm
nlp = spacy.load("en_core_web_sm")
# Imprime en pantalla los nombres de los componentes del pipeline
print(nlp.pipe_names)
# Imprime en pantalla el pipeline entero de tuples (name, component)
print(nlp.pipeline)
| 23.727273 | 68 | 0.789272 | import spacy
# Carga el modelo en_core_web_sm
nlp = spacy.load("en_core_web_sm")
# Imprime en pantalla los nombres de los componentes del pipeline
print(nlp.pipe_names)
# Imprime en pantalla el pipeline entero de tuples (name, component)
print(nlp.pipeline)
| 0 | 0 | 0 |
7e3761c958322e5c09482795e65d3b825c49da18 | 8,390 | py | Python | catkin_ws/customgripper/class_program.py | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | catkin_ws/customgripper/class_program.py | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | catkin_ws/customgripper/class_program.py | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import lib_robotis_xm430 as xm430
import sys
import time
# import rospy
# from o2as_precision_gripper.srv import *
######################################################################################################
#outer gripper related functions
#################################... | 41.127451 | 116 | 0.612277 | #!/usr/bin/env python
import lib_robotis_xm430 as xm430
import sys
import time
# import rospy
# from o2as_precision_gripper.srv import *
class PrecisionGripper:
def __init__(self, serial_port = '/dev/ttyUSB0'):
self.dynamixel = xm430.USB2Dynamixel_Device( serial_port )
self.p1 = xm430.Robotis_Serv... | 6,883 | 2 | 499 |
2c283803f4db9ee467a08376710462c42a7f4f95 | 212 | py | Python | tests/layers/__init__.py | ntaylorwss/megatron | a6c572e04583e21715f3eaf35630cb4d75f686f7 | [
"MIT"
] | 9 | 2018-08-21T21:30:08.000Z | 2021-12-29T06:39:05.000Z | tests/layers/__init__.py | ntaylorwss/megatron | a6c572e04583e21715f3eaf35630cb4d75f686f7 | [
"MIT"
] | 6 | 2018-08-23T18:30:48.000Z | 2020-03-30T22:08:13.000Z | tests/layers/__init__.py | ntaylorwss/megatron | a6c572e04583e21715f3eaf35630cb4d75f686f7 | [
"MIT"
] | 3 | 2018-08-26T15:53:57.000Z | 2020-07-21T12:06:55.000Z | from . import test_adapters
from . import test_explore
from . import test_image
from . import test_metrics
from . import test_missing
from . import test_numeric
from . import test_shaping
from . import test_text
| 23.555556 | 27 | 0.811321 | from . import test_adapters
from . import test_explore
from . import test_image
from . import test_metrics
from . import test_missing
from . import test_numeric
from . import test_shaping
from . import test_text
| 0 | 0 | 0 |
6f16493308a79e424047abaee500b6e1f51f7a9e | 2,189 | py | Python | wageubn/function/activation.py | PannenetsF/wageubn | 8c93ae34123bb3576fd694f30cf3149cc4cc54eb | [
"BSD-3-Clause"
] | 4 | 2021-03-17T06:01:47.000Z | 2022-02-23T07:32:19.000Z | wageubn/function/activation.py | PannenetsF/wageubn | 8c93ae34123bb3576fd694f30cf3149cc4cc54eb | [
"BSD-3-Clause"
] | null | null | null | wageubn/function/activation.py | PannenetsF/wageubn | 8c93ae34123bb3576fd694f30cf3149cc4cc54eb | [
"BSD-3-Clause"
] | null | null | null | """
Provide quantilized form of torch.nn.modules.activation
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from .number import directquant, alldirectquant
| 34.203125 | 69 | 0.627227 | """
Provide quantilized form of torch.nn.modules.activation
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from .number import directquant, alldirectquant
class ReLU(nn.ReLU):
def __init__(self,
inplace=False,
input_dec_bit_width=8,
acti... | 1,801 | -1 | 206 |
a24ec8652a0b3581cf0c1785150274515c4cea3f | 3,815 | py | Python | Cura/libCharon/Charon/Service/FileService.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/libCharon/Charon/Service/FileService.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/libCharon/Charon/Service/FileService.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | import dbus
import logging
import RequestQueue
log = logging.getLogger(__name__)
## The main interface for the Charon file service.
#
# This contains the main interface definition for the Charon file service.
# It is exposed over DBus as the "nl.ultimaker.charon" service, with
# "/nl/ultimaker/charon" as its ... | 42.388889 | 135 | 0.690695 | import dbus
import logging
import RequestQueue
log = logging.getLogger(__name__)
## The main interface for the Charon file service.
#
# This contains the main interface definition for the Charon file service.
# It is exposed over DBus as the "nl.ultimaker.charon" service, with
# "/nl/ultimaker/charon" as its ... | 876 | 2,245 | 22 |
a269ce3c583ec8df9ab3fc850326151bbfe83c8b | 1,401 | py | Python | Distance/calculateDistance.py | matheuscr30/Clustering-Algorithms | 17013588e33e39c98885df29a0d52b62268515ce | [
"MIT"
] | null | null | null | Distance/calculateDistance.py | matheuscr30/Clustering-Algorithms | 17013588e33e39c98885df29a0d52b62268515ce | [
"MIT"
] | 11 | 2020-01-28T22:59:24.000Z | 2022-03-11T23:59:04.000Z | Distance/calculateDistance.py | matheuscr30/Clustering-Algorithms | 17013588e33e39c98885df29a0d52b62268515ce | [
"MIT"
] | null | null | null | from HelpersCsv import ParseCsv, WriteCsv
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--path', '-p', help="path of input data", type=str)
parser.add_argument('--hasheaders', '-hh', help="if file has headers", type=int, default=0)
parser.add_argument('--distance', '-d', help="pass... | 28.591837 | 98 | 0.598144 | from HelpersCsv import ParseCsv, WriteCsv
import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--path', '-p', help="path of input data", type=str)
parser.add_argument('--hasheaders', '-hh', help="if file has headers", type=int, default=0)
parser.add_argument('--distance', '-d', help="pass... | 726 | 0 | 23 |
28f5cd219b732f555d9e3a70395463b9af0a9535 | 643 | py | Python | contrib/vcl/source/vcl_build_launcher.py | giantcroc/envoy | c535d5abf8d106925070fe6fd018a716e6bf2bf1 | [
"Apache-2.0"
] | 17,703 | 2017-09-14T18:23:43.000Z | 2022-03-31T22:04:17.000Z | contrib/vcl/source/vcl_build_launcher.py | giantcroc/envoy | c535d5abf8d106925070fe6fd018a716e6bf2bf1 | [
"Apache-2.0"
] | 15,957 | 2017-09-14T16:38:22.000Z | 2022-03-31T23:56:30.000Z | contrib/vcl/source/vcl_build_launcher.py | giantcroc/envoy | c535d5abf8d106925070fe6fd018a716e6bf2bf1 | [
"Apache-2.0"
] | 3,780 | 2017-09-14T18:58:47.000Z | 2022-03-31T17:10:47.000Z | #!/usr/bin/python
# Launcher for building vcl
import os
import subprocess
import sys
def main():
""" VCL builder script """
# find path to helper script
script_path = os.path.dirname(os.path.abspath(sys.argv[0]))
vcl_build = f"{script_path}/{sys.argv[1]}"
# find path to vpp/vcl source code
... | 21.433333 | 63 | 0.673406 | #!/usr/bin/python
# Launcher for building vcl
import os
import subprocess
import sys
def main():
""" VCL builder script """
# find path to helper script
script_path = os.path.dirname(os.path.abspath(sys.argv[0]))
vcl_build = f"{script_path}/{sys.argv[1]}"
# find path to vpp/vcl source code
... | 0 | 0 | 0 |
3870853e2cf8a048e8ca46bb1ffa724b2ca8a3f6 | 729 | py | Python | tests/integration/files/lj/lj.py | yjw0510/freud | b47b36d9afacc0833febfd51755b0e94664c0c07 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/files/lj/lj.py | yjw0510/freud | b47b36d9afacc0833febfd51755b0e94664c0c07 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/files/lj/lj.py | yjw0510/freud | b47b36d9afacc0833febfd51755b0e94664c0c07 | [
"BSD-3-Clause"
] | null | null | null | import hoomd
from hoomd import md
hoomd.context.initialize()
# Create a 10x10x10 simple cubic lattice of particles with type name A
hoomd.init.create_lattice(
unitcell=hoomd.lattice.sc(a=2.0, type_name='A'), n=10)
# Specify Lennard-Jones interactions between particle pairs
nl = md.nlist.cell()
lj = md.pair.lj(r_c... | 29.16 | 78 | 0.743484 | import hoomd
from hoomd import md
hoomd.context.initialize()
# Create a 10x10x10 simple cubic lattice of particles with type name A
hoomd.init.create_lattice(
unitcell=hoomd.lattice.sc(a=2.0, type_name='A'), n=10)
# Specify Lennard-Jones interactions between particle pairs
nl = md.nlist.cell()
lj = md.pair.lj(r_c... | 0 | 0 | 0 |
96f37025bb6115272c07aaf8d5502fc19e7d99d4 | 3,646 | py | Python | src/edubot/snapext/joystick/__init__.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/snapext/joystick/__init__.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/snapext/joystick/__init__.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | ##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 29.403226 | 121 | 0.614372 | ##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 1,814 | 388 | 73 |
34a001a3242359b21afd92117d6b13c8f44f5df2 | 1,155 | py | Python | km_api/know_me/profile/tests/models/test_model_functions.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 4 | 2017-08-03T00:46:31.000Z | 2018-11-06T03:32:32.000Z | km_api/know_me/profile/tests/models/test_model_functions.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 526 | 2017-06-27T18:13:59.000Z | 2021-06-10T18:00:21.000Z | km_api/know_me/profile/tests/models/test_model_functions.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 1 | 2017-07-10T19:46:27.000Z | 2017-07-10T19:46:27.000Z | from unittest import mock
from know_me.profile import models
def test_get_media_resource_upload_path():
"""
Media Resources should be stored with their original filename in a
folder titled ``know-me/users/{id}/media-resources``.
"""
resource = mock.Mock(name="Mock Media Resource")
resource.km... | 30.394737 | 78 | 0.706494 | from unittest import mock
from know_me.profile import models
def test_get_media_resource_upload_path():
"""
Media Resources should be stored with their original filename in a
folder titled ``know-me/users/{id}/media-resources``.
"""
resource = mock.Mock(name="Mock Media Resource")
resource.km... | 0 | 0 | 0 |
4973c6f101c4ca80c4de1565af88105586bd7d3d | 231 | py | Python | twkit/curation/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 5 | 2018-12-06T16:14:14.000Z | 2020-05-22T07:36:45.000Z | twkit/curation/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | null | null | null | twkit/curation/__init__.py | evaperon/twAwler | 8e9f2064cad846177ed6547b9f56f053226a2d5e | [
"Apache-2.0"
] | 3 | 2020-04-20T07:20:18.000Z | 2021-08-19T17:31:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################
# (c) 2016-2020 Polyvios Pratikakis
# polyvios@ics.forth.gr
###########################################
#__all__ = ['utils']
''' empty '''
| 23.1 | 43 | 0.380952 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################
# (c) 2016-2020 Polyvios Pratikakis
# polyvios@ics.forth.gr
###########################################
#__all__ = ['utils']
''' empty '''
| 0 | 0 | 0 |
7983fe40ed15838a7b1f9ef89f8b2677b9927e6f | 1,470 | py | Python | day003/list2.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | 5 | 2018-04-07T02:45:04.000Z | 2022-03-29T02:52:03.000Z | day003/list2.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | null | null | null | day003/list2.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | 5 | 2019-05-10T03:12:17.000Z | 2021-01-16T10:54:41.000Z | # coding=utf-8
"""List II - In-place functions: Reverse, Sort and Extend.
Examples with in-place list functions. In-place functions changes
the original object and return None after calling it.
"""
def do_something_magical(animes, tvshows):
"""Use some list methods."""
animes.reverse()
print("Inv... | 45.9375 | 168 | 0.670068 | # coding=utf-8
"""List II - In-place functions: Reverse, Sort and Extend.
Examples with in-place list functions. In-place functions changes
the original object and return None after calling it.
"""
def do_something_magical(animes, tvshows):
"""Use some list methods."""
animes.reverse()
print("Inv... | 0 | 0 | 0 |
407a2686af14eded1db450d38619ff5ecf832898 | 1,384 | py | Python | examples/rtp_freespace_density.py | zpeng2/ald | 040ce6176998a9ca024eb9f420e8c6c63ca6af81 | [
"MIT"
] | null | null | null | examples/rtp_freespace_density.py | zpeng2/ald | 040ce6176998a9ca024eb9f420e8c6c63ca6af81 | [
"MIT"
] | 1 | 2020-11-29T06:46:22.000Z | 2020-11-29T06:46:22.000Z | examples/rtp_freespace_density.py | zpeng2/ald | 040ce6176998a9ca024eb9f420e8c6c63ca6af81 | [
"MIT"
] | null | null | null | import ald
import numpy as np
import h5py
U0 = 1.0
tauR = 1.2
alpha = 1.2
particle = ald.Pareto(U0=U0, tauR=tauR, alpha=alpha)
flow = ald.ZeroVelocity()
domain = ald.Box()
ic = ald.InitialConfig(
x=ald.Uniform(domain.left, domain.right),
y=ald.Uniform(domain.left, domain.right),
theta=ald.Uniform(0, 2 *... | 23.862069 | 77 | 0.699422 | import ald
import numpy as np
import h5py
U0 = 1.0
tauR = 1.2
alpha = 1.2
particle = ald.Pareto(U0=U0, tauR=tauR, alpha=alpha)
flow = ald.ZeroVelocity()
domain = ald.Box()
ic = ald.InitialConfig(
x=ald.Uniform(domain.left, domain.right),
y=ald.Uniform(domain.left, domain.right),
theta=ald.Uniform(0, 2 *... | 0 | 0 | 0 |
e4e71f3f61b4c80f350c140b3136ab566c030b2e | 1,541 | py | Python | angka_detik.py | suaraksara/Berita-Angka | 0a2f48019b521a2d920859087e957986a18c76d8 | [
"MIT"
] | null | null | null | angka_detik.py | suaraksara/Berita-Angka | 0a2f48019b521a2d920859087e957986a18c76d8 | [
"MIT"
] | null | null | null | angka_detik.py | suaraksara/Berita-Angka | 0a2f48019b521a2d920859087e957986a18c76d8 | [
"MIT"
] | null | null | null | #Skrip alfa
from requests import get
from bs4 import BeautifulSoup as bs
import pandas as pd
hari = input('Tanggal? (dua digit): \n')
bulan = input('Bulan? (dua digit): \n')
tahun = input('Tahun? (empat digit): \n')
x = bulan+'/'+hari+'/'+tahun
halaman_detik = [str(i) for i in range(1, 21)]
#https://news.detik.com/... | 26.568966 | 69 | 0.647631 | #Skrip alfa
from requests import get
from bs4 import BeautifulSoup as bs
import pandas as pd
hari = input('Tanggal? (dua digit): \n')
bulan = input('Bulan? (dua digit): \n')
tahun = input('Tahun? (empat digit): \n')
x = bulan+'/'+hari+'/'+tahun
halaman_detik = [str(i) for i in range(1, 21)]
def ada_angka(kalimat):
... | 53 | 0 | 23 |
40828217c324523435282edb120e9c0948dd2fa5 | 464 | py | Python | aws/cdk/simple-vpc/simple_vpc/simple_vpc_stack.py | andrewdmay/infrastructure-as-code | 361155938c035bbffd73631048dea3eb45aeb5a3 | [
"MIT"
] | 3 | 2020-01-08T17:31:27.000Z | 2020-01-08T19:01:42.000Z | aws/cdk/simple-vpc/simple_vpc/simple_vpc_stack.py | andrewdmay/infrastructure-as-code | 361155938c035bbffd73631048dea3eb45aeb5a3 | [
"MIT"
] | null | null | null | aws/cdk/simple-vpc/simple_vpc/simple_vpc_stack.py | andrewdmay/infrastructure-as-code | 361155938c035bbffd73631048dea3eb45aeb5a3 | [
"MIT"
] | 1 | 2020-01-08T18:02:36.000Z | 2020-01-08T18:02:36.000Z | from aws_cdk import (
aws_ec2 as ec2,
core
)
| 24.421053 | 73 | 0.579741 | from aws_cdk import (
aws_ec2 as ec2,
core
)
class SimpleVpcStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
public = ec2.SubnetConfiguration(
name='Public', subnet_type=ec2.SubnetType.PUBLIC
... | 349 | 12 | 50 |
686bbd1aa6cd86e123b351d54c8d59fff5e3faee | 992 | py | Python | toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py | mikidep/tosca-parser | 6cef1dfc712165c4d75aeae36f6bd4758fcfff5c | [
"Apache-2.0"
] | 99 | 2015-09-02T23:07:47.000Z | 2022-02-02T14:13:07.000Z | toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py | mikidep/tosca-parser | 6cef1dfc712165c4d75aeae36f6bd4758fcfff5c | [
"Apache-2.0"
] | 26 | 2019-09-09T04:45:17.000Z | 2021-06-25T15:23:52.000Z | toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py | mikidep/tosca-parser | 6cef1dfc712165c4d75aeae36f6bd4758fcfff5c | [
"Apache-2.0"
] | 59 | 2015-10-28T09:14:01.000Z | 2022-02-13T13:54:24.000Z | #!/usr/bin/python
# 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 agreed to in writi... | 38.153846 | 78 | 0.690524 | #!/usr/bin/python
# 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 agreed to in writi... | 0 | 0 | 0 |
63b9af183e4686b893f0f1a3877ba6fec57f8845 | 3,701 | py | Python | universum/__main__.py | Soheil-Momeni/Universum | 9138957350e35954578254bce49400c7bb9ee525 | [
"BSD-2-Clause"
] | null | null | null | universum/__main__.py | Soheil-Momeni/Universum | 9138957350e35954578254bce49400c7bb9ee525 | [
"BSD-2-Clause"
] | null | null | null | universum/__main__.py | Soheil-Momeni/Universum | 9138957350e35954578254bce49400c7bb9ee525 | [
"BSD-2-Clause"
] | 1 | 2020-12-23T15:14:32.000Z | 2020-12-23T15:14:32.000Z | from typing import List, Optional
import signal
import sys
from . import __version__, __title__
from .api import Api
from .github_handler import GithubHandler
from .config_creator import ConfigCreator
from .lib.ci_exception import SilentAbortException
from .lib.gravity import define_arguments_recursive, construct_comp... | 36.643564 | 111 | 0.7117 | from typing import List, Optional
import signal
import sys
from . import __version__, __title__
from .api import Api
from .github_handler import GithubHandler
from .config_creator import ConfigCreator
from .lib.ci_exception import SilentAbortException
from .lib.gravity import define_arguments_recursive, construct_comp... | 2,925 | 0 | 69 |
ec82761d9e71081eae21c17c0d1324246c78aaf2 | 3,291 | py | Python | apps/user_operation/serializers.py | GITliyanfeng/vue-djang-shop | a49d75eb74914deffcff6cf594d416d284e64b01 | [
"MIT"
] | 1 | 2020-03-25T13:48:55.000Z | 2020-03-25T13:48:55.000Z | apps/user_operation/serializers.py | GITliyanfeng/vue-djang-shop | a49d75eb74914deffcff6cf594d416d284e64b01 | [
"MIT"
] | 8 | 2020-06-05T20:07:10.000Z | 2022-03-11T23:42:18.000Z | apps/user_operation/serializers.py | GITliyanfeng/vue-djang-shop | a49d75eb74914deffcff6cf594d416d284e64b01 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# __author__ : py_lee
# __time__ : '18-12-14 下午2:54'
import re
from rest_framework import serializers
from rest_framework.validators import UniqueTogetherValidator
from user_operation.models import UserFav, UserLeavingMessage, UserAddress
from goods.serializer import UserFavGoodsSerializers
f... | 32.584158 | 120 | 0.673048 | # -*- coding: utf-8 -*-
# __author__ : py_lee
# __time__ : '18-12-14 下午2:54'
import re
from rest_framework import serializers
from rest_framework.validators import UniqueTogetherValidator
from user_operation.models import UserFav, UserLeavingMessage, UserAddress
from goods.serializer import UserFavGoodsSerializers
f... | 236 | 1,064 | 131 |
2163afdbd31907c387d52ba41b87c4a42c3e1b53 | 1,009 | py | Python | tree_guardian/constants.py | fadich/tree-guardian | 5214c0474834fca0b12ff43fc55de3960da59d8d | [
"MIT"
] | 1 | 2019-08-22T14:00:45.000Z | 2019-08-22T14:00:45.000Z | tree_guardian/constants.py | fadich/tree-guardian | 5214c0474834fca0b12ff43fc55de3960da59d8d | [
"MIT"
] | 3 | 2019-08-29T11:21:38.000Z | 2021-09-18T18:24:04.000Z | tree_guardian/constants.py | fadich/tree-guardian | 5214c0474834fca0b12ff43fc55de3960da59d8d | [
"MIT"
] | null | null | null | from .utils import get_gitignored
EXCLUDE_DOC = {'*.md', '*.doc', '*.docx', '*.txt', '*.pdf', }
EXCLUDE_CONFIG = {'*.cfg', '*.ini', '*.conf', }
EXCLUDE_YAML = {'*.yml', '*.yaml', }
EXCLUDE_BASH = {'*.sh', }
EXCLUDE_GIT = {'.git', '.gitignore', }
EXCLUDE_DOCKER = {'Dockerfile', '.dockerignore', }
EXCLUDE_VIRTUALENV ... | 36.035714 | 100 | 0.667988 | from .utils import get_gitignored
EXCLUDE_DOC = {'*.md', '*.doc', '*.docx', '*.txt', '*.pdf', }
EXCLUDE_CONFIG = {'*.cfg', '*.ini', '*.conf', }
EXCLUDE_YAML = {'*.yml', '*.yaml', }
EXCLUDE_BASH = {'*.sh', }
EXCLUDE_GIT = {'.git', '.gitignore', }
EXCLUDE_DOCKER = {'Dockerfile', '.dockerignore', }
EXCLUDE_VIRTUALENV ... | 0 | 0 | 0 |
16f2cca1071a6fc3da199ef9f69b971a532d7653 | 376 | py | Python | lists_manip.py | eqperes/useful_functions | 687a80de9694ca5f12ff26500288d01386b65280 | [
"MIT"
] | null | null | null | lists_manip.py | eqperes/useful_functions | 687a80de9694ca5f12ff26500288d01386b65280 | [
"MIT"
] | null | null | null | lists_manip.py | eqperes/useful_functions | 687a80de9694ca5f12ff26500288d01386b65280 | [
"MIT"
] | null | null | null |
#Source: http://code.activestate.com/recipes/578948-flattening-an-arbitrarily-nested-list-in-python/
def flatten(lis):
"""Given a list, possibly nested to any level, return it flattened."""
new_lis = []
for item in lis:
if type(item) == type([]):
new_lis.extend(flatten(item))
el... | 31.333333 | 100 | 0.630319 |
#Source: http://code.activestate.com/recipes/578948-flattening-an-arbitrarily-nested-list-in-python/
def flatten(lis):
"""Given a list, possibly nested to any level, return it flattened."""
new_lis = []
for item in lis:
if type(item) == type([]):
new_lis.extend(flatten(item))
el... | 0 | 0 | 0 |
bda034eb5d300bef8169ef8f0b6f9cf24b0b4798 | 904 | py | Python | WebClassApp/categorias/urls.py | jesuscol96/WebClassApp | 092bde4cb16f09f3efafc32af904715fae59773a | [
"MIT"
] | null | null | null | WebClassApp/categorias/urls.py | jesuscol96/WebClassApp | 092bde4cb16f09f3efafc32af904715fae59773a | [
"MIT"
] | null | null | null | WebClassApp/categorias/urls.py | jesuscol96/WebClassApp | 092bde4cb16f09f3efafc32af904715fae59773a | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from . import views
app_name = 'categorias'
urlpatterns = [
path('', views.index, name='index'),
path('crear_categoria', views.crear_categoria, name='crear_categoria'),
path('process_new_categories', views.process_new_categories, name='process_new_categories'),
... | 53.176471 | 121 | 0.754425 | from django.urls import path, re_path
from . import views
app_name = 'categorias'
urlpatterns = [
path('', views.index, name='index'),
path('crear_categoria', views.crear_categoria, name='crear_categoria'),
path('process_new_categories', views.process_new_categories, name='process_new_categories'),
... | 0 | 0 | 0 |
b27a4485a770360ca4a813e6c1578ef01d9361f8 | 4,874 | py | Python | revscoring/revscoring/datasources/meta/selectors.py | yafeunteun/wikipedia-spam-classifier | fca782b39b287fbc0b2dd54f8e2bf33c6d3bc519 | [
"MIT"
] | 2 | 2016-10-26T18:58:53.000Z | 2017-06-22T20:11:20.000Z | revscoring/revscoring/datasources/meta/selectors.py | yafeunteun/wikipedia-spam-classifier | fca782b39b287fbc0b2dd54f8e2bf33c6d3bc519 | [
"MIT"
] | null | null | null | revscoring/revscoring/datasources/meta/selectors.py | yafeunteun/wikipedia-spam-classifier | fca782b39b287fbc0b2dd54f8e2bf33c6d3bc519 | [
"MIT"
] | null | null | null | """
These meta-datasources operate on :class:`revscoring.Datasource`'s that return
a flat `dict` of key-value pairs (aka a "table") and filter ("select") keys
and/or weight values.
.. autoclass:: revscoring.datasources.meta.selectors.tfidf
.. autoclass:: revscoring.datasources.meta.selectors.filter_keys
"""
from co... | 35.064748 | 78 | 0.595404 | """
These meta-datasources operate on :class:`revscoring.Datasource`'s that return
a flat `dict` of key-value pairs (aka a "table") and filter ("select") keys
and/or weight values.
.. autoclass:: revscoring.datasources.meta.selectors.tfidf
.. autoclass:: revscoring.datasources.meta.selectors.filter_keys
"""
from co... | 3,018 | 0 | 210 |
46d1d0a30e460a326b014b2e36972c9af117564a | 1,864 | py | Python | screenbreak/work.py | gythaogg/screenbreak | 590c057006ab2dc6f1c2b1ff962f7b2d9d8fe552 | [
"MIT"
] | null | null | null | screenbreak/work.py | gythaogg/screenbreak | 590c057006ab2dc6f1c2b1ff962f7b2d9d8fe552 | [
"MIT"
] | null | null | null | screenbreak/work.py | gythaogg/screenbreak | 590c057006ab2dc6f1c2b1ff962f7b2d9d8fe552 | [
"MIT"
] | null | null | null | import argparse
import logging
import os
import time
from .helper import notify
from .state import QuitNow, TimedState
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s: %(message)s', level=logging.INFO)
main()
| 25.534247 | 78 | 0.616953 | import argparse
import logging
import os
import time
from .helper import notify
from .state import QuitNow, TimedState
class Work(TimedState):
def __init__(self, interval_mins=25, message='Work away!'):
super().__init__(interval_mins, message, 'break')
return
class Relax(TimedState):
def __... | 1,415 | 9 | 197 |
f8ba945f970cea6b4599c851e3229fa6f5df95e4 | 1,673 | py | Python | main.py | GZR1996/dcgan_comic | c1ece84cd8768e2834b8b106a0933819d1e45203 | [
"Apache-2.0"
] | null | null | null | main.py | GZR1996/dcgan_comic | c1ece84cd8768e2834b8b106a0933819d1e45203 | [
"Apache-2.0"
] | null | null | null | main.py | GZR1996/dcgan_comic | c1ece84cd8768e2834b8b106a0933819d1e45203 | [
"Apache-2.0"
] | null | null | null | import os
import scipy.misc #
import numpy as np
from model import DCGAN
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 25, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.0002, "Learning rate of for adam [0.0002]")... | 61.962963 | 138 | 0.754334 | import os
import scipy.misc #
import numpy as np
from model import DCGAN
from utils import pp, visualize, to_json, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 25, "Epoch to train [25]")
flags.DEFINE_float("learning_rate", 0.0002, "Learning rate of for adam [0.0002]")... | 0 | 0 | 0 |
be1f856e35211d4ca42bec9dbe6ee0b7471ddcf5 | 423 | py | Python | mmdet3d/models/roi_heads/__init__.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 12 | 2021-03-17T09:07:18.000Z | 2022-01-21T01:37:42.000Z | mmdet3d/models/roi_heads/__init__.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 1 | 2020-08-11T05:44:29.000Z | 2020-08-11T05:44:29.000Z | mmdet3d/models/roi_heads/__init__.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 2 | 2021-03-17T09:25:15.000Z | 2021-04-22T09:15:58.000Z | from .base_3droi_head import Base3DRoIHead
from .bbox_heads import PartA2BboxHead
from .mask_heads import PointwiseSemanticHead
from .part_aggregation_roi_head import PartAggregationROIHead
from .roi_extractors import Single3DRoIAwareExtractor, SingleRoIExtractor
__all__ = [
'Base3DRoIHead', 'PartAggregationROIHea... | 38.454545 | 73 | 0.843972 | from .base_3droi_head import Base3DRoIHead
from .bbox_heads import PartA2BboxHead
from .mask_heads import PointwiseSemanticHead
from .part_aggregation_roi_head import PartAggregationROIHead
from .roi_extractors import Single3DRoIAwareExtractor, SingleRoIExtractor
__all__ = [
'Base3DRoIHead', 'PartAggregationROIHea... | 0 | 0 | 0 |
868e2acf218f907a34bb9a83cb025f85f14a62e7 | 141 | py | Python | tests/conftest.py | sbidoul/wodoo | ea9801d287446bd0e4613d407f92bbad3b02e5bc | [
"MIT"
] | 1 | 2021-12-22T12:55:19.000Z | 2021-12-22T12:55:19.000Z | tests/conftest.py | sbidoul/wodoo | ea9801d287446bd0e4613d407f92bbad3b02e5bc | [
"MIT"
] | null | null | null | tests/conftest.py | sbidoul/wodoo | ea9801d287446bd0e4613d407f92bbad3b02e5bc | [
"MIT"
] | 1 | 2019-12-19T13:35:03.000Z | 2019-12-19T13:35:03.000Z | from pathlib import Path
import pytest
@pytest.fixture # type: ignore
| 15.666667 | 41 | 0.70922 | from pathlib import Path
import pytest
@pytest.fixture # type: ignore
def data_path() -> Path:
return Path(__file__).parent / "data"
| 45 | 0 | 22 |
9b3d05d66f38b67ad7eff1a9e113c8ce78b1a9b4 | 5,254 | py | Python | lib/processors/loop.py | webyaml/core | 3820c61c24624375e2d993c2817b6ff3cadb9960 | [
"Apache-2.0"
] | 10 | 2018-05-05T17:11:08.000Z | 2022-02-09T20:28:11.000Z | lib/processors/loop.py | webyaml/core | 3820c61c24624375e2d993c2817b6ff3cadb9960 | [
"Apache-2.0"
] | 6 | 2018-05-07T20:15:31.000Z | 2018-09-27T23:27:26.000Z | lib/processors/loop.py | webyaml/core | 3820c61c24624375e2d993c2817b6ff3cadb9960 | [
"Apache-2.0"
] | 1 | 2021-08-09T04:21:56.000Z | 2021-08-09T04:21:56.000Z | # path: lib/processors
# filename: loop.py
# description: WSGI application image file processors
'''
# make python2 strings and dictionaries behave like python3
from __future__ import unicode_literals
try:
from builtins import dict, str
except ImportError:
from __builtin__ import dict, str
Copyright 2017 Mark M... | 22.262712 | 88 | 0.627903 | # path: lib/processors
# filename: loop.py
# description: WSGI application image file processors
'''
# make python2 strings and dictionaries behave like python3
from __future__ import unicode_literals
try:
from builtins import dict, str
except ImportError:
from __builtin__ import dict, str
Copyright 2017 Mark M... | 4,102 | 0 | 25 |
73ee26c7912f333d89891f30cf9566f326b22daa | 3,799 | py | Python | sentiment-topic-keyword-server/Topics/Seeds22/labeledCluster.py | SubhasisDutta/Testanalyzer | 9a338644bdd342ff22a99a7d689f0ba228041398 | [
"Apache-2.0"
] | 3 | 2017-09-06T03:17:00.000Z | 2020-08-16T05:06:11.000Z | sentiment-topic-keyword-server/Topics/Seeds22/labeledCluster.py | SubhasisDutta/text-analysis | 9a338644bdd342ff22a99a7d689f0ba228041398 | [
"Apache-2.0"
] | null | null | null | sentiment-topic-keyword-server/Topics/Seeds22/labeledCluster.py | SubhasisDutta/text-analysis | 9a338644bdd342ff22a99a7d689f0ba228041398 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2015 Serendio Inc.
Author - Satish Palaniappan
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 agreed ... | 26.020548 | 168 | 0.715715 | '''
Copyright 2015 Serendio Inc.
Author - Satish Palaniappan
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 agreed ... | 158 | 0 | 46 |
c5c28c66534a3487f6d9e1a8a954addf9aa66fd9 | 2,749 | py | Python | agents/enjoy_pybullet_humanoid.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | 36 | 2021-02-26T22:54:14.000Z | 2022-03-20T12:59:48.000Z | agents/enjoy_pybullet_humanoid.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | null | null | null | agents/enjoy_pybullet_humanoid.py | nnaisense/pgpelib | d00907fe4b237e875ac0cc5b9d9c22591e4a7206 | [
"BSD-3-Clause"
] | 3 | 2021-03-17T13:44:28.000Z | 2022-01-11T11:15:23.000Z | from pgpelib.restore import to_torch_module
from typing import List, Optional
import sys
import torch
from torch import nn
import numpy as np
import gym
import pybullet_envs
from time import sleep
from copy import deepcopy
if __name__ == "__main__":
main(*(sys.argv[1:]))
| 31.965116 | 89 | 0.639869 | from pgpelib.restore import to_torch_module
from typing import List, Optional
import sys
import torch
from torch import nn
import numpy as np
import gym
import pybullet_envs
from time import sleep
from copy import deepcopy
def evaluate_artifact(artifact_name: str,
ntimes: int,
... | 2,422 | 0 | 46 |
82c3d5fb9cca3bca73607668c563158ceae9a3a8 | 9,352 | py | Python | src/ast_toolbox/mcts/AdaptiveStressTesting.py | hdelecki/AdaptiveStressTestingToolbox | 184d7d7f1b4acb65eecb749e3c3a78cbcfc3c4ed | [
"MIT"
] | 29 | 2019-01-09T23:56:35.000Z | 2022-03-18T03:41:10.000Z | src/ast_toolbox/mcts/AdaptiveStressTesting.py | hdelecki/AdaptiveStressTestingToolbox | 184d7d7f1b4acb65eecb749e3c3a78cbcfc3c4ed | [
"MIT"
] | 39 | 2019-01-10T00:32:26.000Z | 2022-03-12T00:29:05.000Z | src/ast_toolbox/mcts/AdaptiveStressTesting.py | hdelecki/AdaptiveStressTestingToolbox | 184d7d7f1b4acb65eecb749e3c3a78cbcfc3c4ed | [
"MIT"
] | 11 | 2019-01-10T08:11:47.000Z | 2021-12-28T15:56:02.000Z | import pickle
import numpy as np
# import garage.misc.logger as logger
from dowel import logger
from dowel import tabular
import ast_toolbox.mcts.MDP as MDP
class ASTParams:
"""Structure that stores internal parameters for AST.
Parameters
----------
max_steps : int, optional
The maximum sea... | 28.687117 | 117 | 0.555389 | import pickle
import numpy as np
# import garage.misc.logger as logger
from dowel import logger
from dowel import tabular
import ast_toolbox.mcts.MDP as MDP
class ASTParams:
"""Structure that stores internal parameters for AST.
Parameters
----------
max_steps : int, optional
The maximum sea... | 1,580 | 836 | 227 |
c5a8d70376532f910b377ec61798a97086f04a5a | 20,658 | py | Python | LocastService.py | thor0215/locast2plex | 2b6291a11269bbee71bf0ef2799c9e97f47c60e5 | [
"MIT"
] | null | null | null | LocastService.py | thor0215/locast2plex | 2b6291a11269bbee71bf0ef2799c9e97f47c60e5 | [
"MIT"
] | null | null | null | LocastService.py | thor0215/locast2plex | 2b6291a11269bbee71bf0ef2799c9e97f47c60e5 | [
"MIT"
] | null | null | null | # pylama:ignore=E722,E303
import json
import sys
import re
from functools import update_wrapper
from datetime import datetime
import urllib.error
import urllib.parse
import urllib.request
import time
import m3u8
| 40.112621 | 127 | 0.568012 | # pylama:ignore=E722,E303
import json
import sys
import re
from functools import update_wrapper
from datetime import datetime
import urllib.error
import urllib.parse
import urllib.request
import time
import m3u8
def handle_url_except(f):
def wrapper_func(self, *args, **kwargs):
try:
return ... | 18,629 | 1,766 | 46 |
6320f81f4e896705d850beb62191a58b10dcbdb7 | 2,155 | py | Python | src/visualization.py | angeladietz/WEC2020 | b1b398462dae4c18681fa01f3de9805f46073371 | [
"MIT"
] | null | null | null | src/visualization.py | angeladietz/WEC2020 | b1b398462dae4c18681fa01f3de9805f46073371 | [
"MIT"
] | null | null | null | src/visualization.py | angeladietz/WEC2020 | b1b398462dae4c18681fa01f3de9805f46073371 | [
"MIT"
] | 2 | 2020-11-14T14:52:56.000Z | 2020-11-14T20:44:42.000Z | import os
import matplotlib as mpl
import matplotlib.pyplot as plt
from .simulator import Simulator
| 29.121622 | 92 | 0.577726 | import os
import matplotlib as mpl
import matplotlib.pyplot as plt
from .simulator import Simulator
def visualize_single_frame(sim):
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.pcolormesh(sim.contamination, ec='lightgrey', lw=1,
cmap='Wistia', norm=mpl.colors.Normalize(0, 99), zorder=1)
... | 2,005 | 0 | 46 |
f7d5d0d815567820b2c2e14ac9cf6e32b2ac9b20 | 14,635 | py | Python | tensorflow_model_analysis/addons/fairness/metrics/fairness_indicators_test.py | jay90099/model-analysis | 4389611ae476686d349bd6d16de39855d491cf0c | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/addons/fairness/metrics/fairness_indicators_test.py | jay90099/model-analysis | 4389611ae476686d349bd6d16de39855d491cf0c | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/addons/fairness/metrics/fairness_indicators_test.py | jay90099/model-analysis | 4389611ae476686d349bd6d16de39855d491cf0c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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, ... | 38.311518 | 81 | 0.584011 | # Copyright 2020 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, ... | 10,116 | 3,200 | 23 |
76d65fde47c18a826293663ac7c0b87d1b2ce9be | 936 | py | Python | events/key_event.py | gbkim000/wxPython | b1604d71cf04801f9efa8b26b935561a88ef1daa | [
"BSD-2-Clause"
] | 80 | 2018-05-25T00:37:25.000Z | 2022-03-13T12:31:02.000Z | events/key_event.py | gbkim000/wxPython | b1604d71cf04801f9efa8b26b935561a88ef1daa | [
"BSD-2-Clause"
] | 1 | 2021-01-08T20:22:52.000Z | 2021-01-08T20:22:52.000Z | events/key_event.py | gbkim000/wxPython | b1604d71cf04801f9efa8b26b935561a88ef1daa | [
"BSD-2-Clause"
] | 32 | 2018-05-24T05:40:55.000Z | 2022-03-24T00:32:11.000Z | #!/usr/bin/python
"""
ZetCode wxPython tutorial
In this example we work with wx.KeyEvent.
author: Jan Bodnar
website: www.zetcode.com
last modified: April 2018
"""
import wx
if __name__ == '__main__':
main()
| 17.018182 | 69 | 0.564103 | #!/usr/bin/python
"""
ZetCode wxPython tutorial
In this example we work with wx.KeyEvent.
author: Jan Bodnar
website: www.zetcode.com
last modified: April 2018
"""
import wx
class Example(wx.Frame):
def __init__(self, *args, **kw):
super(Example, self).__init__(*args, **kw)
self.InitUI()
... | 587 | 3 | 127 |
be66dc89b4cae8f2ff5d0d04b1206d04caa26d25 | 635 | py | Python | Demo/tkinter/www/www7.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | 1 | 2019-10-25T21:41:07.000Z | 2019-10-25T21:41:07.000Z | Demo/tkinter/www/www7.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/tkinter/www/www7.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | #! /usr/bin/env python
# www7.py -- display the contents of a URL in a Text widget
# - set window title
# - make window resizable
# - update display while reading
import sys
import urllib
from Tkinter import *
main()
| 18.676471 | 59 | 0.644094 | #! /usr/bin/env python
# www7.py -- display the contents of a URL in a Text widget
# - set window title
# - make window resizable
# - update display while reading
import sys
import urllib
from Tkinter import *
def main():
if len(sys.argv) != 2 or sys.argv[1][:1] == '-':
print "Usage:", sys.argv[0], "url"
sys.ex... | 392 | 0 | 23 |
21a3514af4c30e4ebd00509940462b21d40133f4 | 395 | py | Python | edaboweb/db_models.py | mineo/edaboweb | f5356f15d0b222d63d57c4fb200f9fe92e8d4a80 | [
"MIT"
] | null | null | null | edaboweb/db_models.py | mineo/edaboweb | f5356f15d0b222d63d57c4fb200f9fe92e8d4a80 | [
"MIT"
] | 1 | 2016-10-30T22:44:21.000Z | 2016-10-30T22:44:21.000Z | edaboweb/db_models.py | mineo/edaboweb | f5356f15d0b222d63d57c4fb200f9fe92e8d4a80 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Copyright © 2015 Wieland Hoffmann
# License: MIT, see LICENSE for details
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import JSONB, UUID
db = SQLAlchemy()
| 26.333333 | 54 | 0.739241 | #!/usr/bin/env python
# coding: utf-8
# Copyright © 2015 Wieland Hoffmann
# License: MIT, see LICENSE for details
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import JSONB, UUID
db = SQLAlchemy()
class Playlist(db.Model):
id = db.Column(db.Integer, primary_key=True)
gid = d... | 0 | 139 | 23 |
adebb7df6affffc6b7b0abeb8b769ff7e9d188bc | 195 | py | Python | scratch.py | 51762344/YOLOX | cbd28064d452c300171da5231038afb098ed2675 | [
"Apache-2.0"
] | null | null | null | scratch.py | 51762344/YOLOX | cbd28064d452c300171da5231038afb098ed2675 | [
"Apache-2.0"
] | null | null | null | scratch.py | 51762344/YOLOX | cbd28064d452c300171da5231038afb098ed2675 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
import cv2
import matplotlib.pyplot as plt
a=torch.randn(6,6,3)
a_s = a.numpy()
im=cv2.imread('./assets/dog.jpg')
plt.imshow(im)
plt.show() | 16.25 | 33 | 0.733333 | import torch
import torch.nn as nn
import numpy as np
import cv2
import matplotlib.pyplot as plt
a=torch.randn(6,6,3)
a_s = a.numpy()
im=cv2.imread('./assets/dog.jpg')
plt.imshow(im)
plt.show() | 0 | 0 | 0 |
9290363d8b39e47a0d8cc51bf955c504a279b43d | 601 | py | Python | jet_guestbook/schema.py | rbw/jet-guestbook | 34be64094cc4628c2d7ea68b747142332ca77176 | [
"MIT"
] | null | null | null | jet_guestbook/schema.py | rbw/jet-guestbook | 34be64094cc4628c2d7ea68b747142332ca77176 | [
"MIT"
] | 4 | 2020-03-24T16:53:56.000Z | 2021-06-01T23:27:09.000Z | jet_guestbook/schema.py | rbw/jet-guestbook | 34be64094cc4628c2d7ea68b747142332ca77176 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from jetfactory.schema import fields, Schema
| 22.259259 | 54 | 0.650582 | # -*- coding: utf-8 -*-
from jetfactory.schema import fields, Schema
class Visitor(Schema):
id = fields.Integer()
name = fields.String()
location = fields.String()
class Visit(Schema):
id = fields.Integer()
visitor = fields.Nested(Visitor)
visited_on = fields.String(attribute='created_on')
... | 0 | 459 | 69 |
49910be82e8dd9f5e8dabbf52a42e3497fa7143d | 267 | py | Python | src/symbolic.py | pvphan/camera-calibration | 46ecdf49410124841aa830abbc959ab922492747 | [
"MIT"
] | null | null | null | src/symbolic.py | pvphan/camera-calibration | 46ecdf49410124841aa830abbc959ab922492747 | [
"MIT"
] | null | null | null | src/symbolic.py | pvphan/camera-calibration | 46ecdf49410124841aa830abbc959ab922492747 | [
"MIT"
] | null | null | null | import sympy
| 19.071429 | 70 | 0.71161 | import sympy
def getModelPointSymbols():
return tuple(sympy.symbols("X Y Z"))
def getExtrinsicSymbols():
return tuple(sympy.symbols("ρx ρy ρz tx ty tz"))
def getHomographySymbols():
return tuple(sympy.symbols("H11 H12 H13 H21 H22 H23 H31 H32 H33"))
| 185 | 0 | 69 |
24c073c8d7c0450b39459d4608731f34e4b16c58 | 792 | py | Python | application/migrations/0001_initial.py | logisticAKB/speech2face | 596404669d69615cfe12884d7a3a0b1a61d85455 | [
"MIT"
] | null | null | null | application/migrations/0001_initial.py | logisticAKB/speech2face | 596404669d69615cfe12884d7a3a0b1a61d85455 | [
"MIT"
] | null | null | null | application/migrations/0001_initial.py | logisticAKB/speech2face | 596404669d69615cfe12884d7a3a0b1a61d85455 | [
"MIT"
] | 1 | 2021-09-06T16:23:14.000Z | 2021-09-06T16:23:14.000Z | # Generated by Django 3.2.2 on 2021-05-15 19:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 30.461538 | 139 | 0.64899 | # Generated by Django 3.2.2 on 2021-05-15 19:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 612 | 23 |
149e36fd81f1056d1a20601972fb126bd8824ab9 | 7,220 | py | Python | crawler/links/link.py | jfharden/simple-web-crawler | 1332148ba3c2246227790f40ac8aeca6400d0fbf | [
"MIT"
] | null | null | null | crawler/links/link.py | jfharden/simple-web-crawler | 1332148ba3c2246227790f40ac8aeca6400d0fbf | [
"MIT"
] | 2 | 2021-03-31T20:03:15.000Z | 2021-12-13T20:45:22.000Z | crawler/links/link.py | jfharden/simple-web-crawler | 1332148ba3c2246227790f40ac8aeca6400d0fbf | [
"MIT"
] | null | null | null | import os.path
from urllib.parse import urlparse
class Link:
"""Represents a Link on a page, links are equivalent in the following circumstances:
* They have the same domain
* They have the same path (after being resolved to an absolute path)
* They may have diffenent schemes (so https ... | 35.219512 | 118 | 0.622715 | import os.path
from urllib.parse import urlparse
class InvalidPathError(ValueError):
pass
class UnknownSchemeError(ValueError):
pass
class Link:
"""Represents a Link on a page, links are equivalent in the following circumstances:
* They have the same domain
* They have the same path (... | 220 | 48 | 127 |
366fc960c554e79b86adbbec5c4e835c9ffb4f69 | 766 | py | Python | src/gig2/build_regions.py | nuuuwan/gig2 | cf37562ee23865e55dd2e897485f0225bdce2bcd | [
"MIT"
] | null | null | null | src/gig2/build_regions.py | nuuuwan/gig2 | cf37562ee23865e55dd2e897485f0225bdce2bcd | [
"MIT"
] | null | null | null | src/gig2/build_regions.py | nuuuwan/gig2 | cf37562ee23865e55dd2e897485f0225bdce2bcd | [
"MIT"
] | null | null | null | import os
from utils import tsv, www
from gig2 import _utils
from gig2._utils import log
| 21.885714 | 61 | 0.518277 | import os
from utils import tsv, www
from gig2 import _utils
from gig2._utils import log
def build_regions():
for region_type in [
'country',
'province',
'district',
'dsd',
'gnd',
'pd',
'ed',
'moh',
'lg',
]:
remote_url = os.path... | 651 | 0 | 23 |
a1fcb95965b611e2f57f9674fd40ec6c0ca538e6 | 4,115 | py | Python | ONNX2MPS.py | prisma-ai/Smelter | 60ccdda977ab6ae70e46d70f300598da3f796761 | [
"MIT"
] | 53 | 2019-05-11T14:06:30.000Z | 2022-03-25T23:19:53.000Z | ONNX2MPS.py | prisma-ai/Smelter | 60ccdda977ab6ae70e46d70f300598da3f796761 | [
"MIT"
] | 2 | 2020-04-15T17:16:43.000Z | 2021-03-02T10:01:32.000Z | ONNX2MPS.py | prisma-ai/Smelter | 60ccdda977ab6ae70e46d70f300598da3f796761 | [
"MIT"
] | 6 | 2019-05-13T02:26:49.000Z | 2022-01-18T10:15:47.000Z | import onnx
from onnx import optimizer
from onnx import numpy_helper
import numpy as np
import argparse
DATA_TYPES = {
np.float32: 1,
np.float16: 10
}
if __name__ == "__main__":
main()
| 29.818841 | 102 | 0.626002 | import onnx
from onnx import optimizer
from onnx import numpy_helper
import numpy as np
import argparse
DATA_TYPES = {
np.float32: 1,
np.float16: 10
}
def tensorInfosToType(tensor_infos, data_type):
return [
onnx.helper.make_tensor_value_info(
tensor_info.name,
DATA_TYPE... | 3,722 | 0 | 184 |
d785d8d7c87b599e9a494b12c4f7beef29c8fbdd | 1,913 | py | Python | questions/migrations/0001_initial.py | shuoO-24/QA-Community | f993fa811e6b266f0ae13612e6183542753a1fc2 | [
"MIT"
] | null | null | null | questions/migrations/0001_initial.py | shuoO-24/QA-Community | f993fa811e6b266f0ae13612e6183542753a1fc2 | [
"MIT"
] | null | null | null | questions/migrations/0001_initial.py | shuoO-24/QA-Community | f993fa811e6b266f0ae13612e6183542753a1fc2 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2022-03-06 18:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 39.040816 | 118 | 0.581809 | # Generated by Django 3.1.4 on 2022-03-06 18:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 1,733 | 23 |
9b4e9b4d0102f015a755cb3895d0c5209066a6ae | 379 | py | Python | olami/ServerProcess.py | Kamigami55/goddog | 5a3efc9c3bf861a89ca14eb15c452e98c2c7eb13 | [
"MIT"
] | 6 | 2017-07-22T07:12:44.000Z | 2020-12-11T09:22:27.000Z | olami/ServerProcess.py | Kamigami55/SigmaGo | 5a3efc9c3bf861a89ca14eb15c452e98c2c7eb13 | [
"MIT"
] | null | null | null | olami/ServerProcess.py | Kamigami55/SigmaGo | 5a3efc9c3bf861a89ca14eb15c452e98c2c7eb13 | [
"MIT"
] | null | null | null | '''
Created on Jun 28, 2017
@author: make ma
'''
from threading import Thread
class ServerProcess(Thread):
'''
classdocs
'''
| 15.16 | 53 | 0.546174 | '''
Created on Jun 28, 2017
@author: make ma
'''
from threading import Thread
class ServerProcess(Thread):
'''
classdocs
'''
def __init__(self):
Thread.__init__(self, name = "ServerProcess")
def init(self, handler):
self.handler = handler
return True
... | 124 | 0 | 97 |
a0100fe204701a8f408e713cbcb9ce4b7f8d35e4 | 3,531 | py | Python | src/function.py | igfish/toyvm | bb1ab371a8c71ba01522556235fc9f017c9b6b8f | [
"MIT"
] | null | null | null | src/function.py | igfish/toyvm | bb1ab371a8c71ba01522556235fc9f017c9b6b8f | [
"MIT"
] | null | null | null | src/function.py | igfish/toyvm | bb1ab371a8c71ba01522556235fc9f017c9b6b8f | [
"MIT"
] | null | null | null | import inspect
from collections.abc import Coroutine as CoroutineBase
from functools import partial
from types import CodeType, FunctionType
from typing import Any
| 27.161538 | 97 | 0.62985 | import inspect
from collections.abc import Coroutine as CoroutineBase
from functools import partial
from types import CodeType, FunctionType
from typing import Any
def make_cell(value):
# Thanks to Alex Gaynor for help with this bit of twistiness.
# Construct an actual cell object by creating a closure right ... | 2,529 | 506 | 326 |
58aafc53d0304d58a50c206c27c0117462a581a1 | 1,375 | py | Python | auto_data_extraction.py | williamabreu/dtn-benckmark | eb76c902caebea741e86087d8e66d004787aea1b | [
"MIT"
] | null | null | null | auto_data_extraction.py | williamabreu/dtn-benckmark | eb76c902caebea741e86087d8e66d004787aea1b | [
"MIT"
] | null | null | null | auto_data_extraction.py | williamabreu/dtn-benckmark | eb76c902caebea741e86087d8e66d004787aea1b | [
"MIT"
] | null | null | null | import os, json
META = None
PATH = os.path.dirname(os.path.realpath(__file__))
with open(f'{PATH}/META.json') as fp:
META = json.load(fp)
OUTPUT = []
for index in META:
transmit_range = META[index]["transmit_range"]
amount_nodes = META[index]["amount_nodes"]
routing_protocol = META[index]["routing_p... | 32.738095 | 98 | 0.610182 | import os, json
META = None
PATH = os.path.dirname(os.path.realpath(__file__))
with open(f'{PATH}/META.json') as fp:
META = json.load(fp)
OUTPUT = []
for index in META:
transmit_range = META[index]["transmit_range"]
amount_nodes = META[index]["amount_nodes"]
routing_protocol = META[index]["routing_p... | 0 | 0 | 0 |
2226c4a6ffd68293da1cad62792b5f2a74b9d938 | 1,642 | py | Python | src/repository/PeopleRepository.py | jose-mariano/cadastro-de-pessoas | 837a6dfddbc4ed848902a7428bd2fa4ce37e1d25 | [
"MIT"
] | null | null | null | src/repository/PeopleRepository.py | jose-mariano/cadastro-de-pessoas | 837a6dfddbc4ed848902a7428bd2fa4ce37e1d25 | [
"MIT"
] | null | null | null | src/repository/PeopleRepository.py | jose-mariano/cadastro-de-pessoas | 837a6dfddbc4ed848902a7428bd2fa4ce37e1d25 | [
"MIT"
] | null | null | null | from src.database import SqliteDatabase
| 20.78481 | 68 | 0.664434 | from src.database import SqliteDatabase
class PeopleRepository:
def __init__(self):
self.repository = SqliteDatabase("people.sqlite3")
def getPeople(self):
sql = """
SELECT name, birth_date, gender FROM people
ORDER BY name;
"""
try:
self.repository.cursor.execute(sql)
result = self.repositor... | 1,424 | 2 | 166 |
a918390cf5df3bf0e6510bc3aa318cd89af5f39c | 3,680 | py | Python | Examples/pendulum_groundtruth.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | 8 | 2020-08-16T00:09:57.000Z | 2021-09-24T00:58:46.000Z | Examples/pendulum_groundtruth.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | null | null | null | Examples/pendulum_groundtruth.py | zehuilu/Learning-from-Sparse-Demonstrations | 4d652635c24f847fe51bc050773762b549ce41c0 | [
"MIT"
] | 2 | 2021-01-26T02:33:13.000Z | 2021-08-25T01:52:07.000Z | #!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/CPDP')
sys.path.append(os.getcwd()+'/JinEnv')
sys.path.append(os.getcwd()+'/lib')
import CPDP
import JinEnv
from casadi import *
from scipy.integrate import solve_ivp
import scipy.io as sio
# ---------------------------------------l... | 37.55102 | 127 | 0.638043 | #!/usr/bin/env python3
import os
import sys
import time
sys.path.append(os.getcwd()+'/CPDP')
sys.path.append(os.getcwd()+'/JinEnv')
sys.path.append(os.getcwd()+'/lib')
import CPDP
import JinEnv
from casadi import *
from scipy.integrate import solve_ivp
import scipy.io as sio
# ---------------------------------------l... | 670 | 0 | 22 |
0003ef7cdcd517a222d67d15824b55d08f4c7264 | 238 | py | Python | python/ccc17j3.py | ThePeeps191/dmoj-solutions | 7137e945f3f595c481ad4d29e1dc3a77d8b26e55 | [
"MIT"
] | 1 | 2022-01-23T16:02:14.000Z | 2022-01-23T16:02:14.000Z | python/ccc17j3.py | ThePeeps191/dmoj-solutions | 7137e945f3f595c481ad4d29e1dc3a77d8b26e55 | [
"MIT"
] | 5 | 2022-01-23T00:16:49.000Z | 2022-01-30T04:37:45.000Z | python/ccc17j3.py | ThePeeps191/dmoj-solutions | 7137e945f3f595c481ad4d29e1dc3a77d8b26e55 | [
"MIT"
] | 1 | 2022-01-23T00:03:47.000Z | 2022-01-23T00:03:47.000Z | # simple math
ab = input().split()
cd = input().split()
t = int(input())
dist_x = abs(int(ab[0]) - int(cd[0]))
dist_y = abs(int(ab[1]) - int(cd[1]))
dist = dist_x + dist_y
if t >= dist and t % 2 == dist % 2:
print("Y")
else:
print("N") | 19.833333 | 37 | 0.563025 | # simple math
ab = input().split()
cd = input().split()
t = int(input())
dist_x = abs(int(ab[0]) - int(cd[0]))
dist_y = abs(int(ab[1]) - int(cd[1]))
dist = dist_x + dist_y
if t >= dist and t % 2 == dist % 2:
print("Y")
else:
print("N") | 0 | 0 | 0 |
3fbc1ded9110638a2f6a40e88fad5d3a4704fc3a | 404 | py | Python | django/zapier.py | Zadigo/django_api | 6dcc54590563f10c1af07d1732f80a33183e99b1 | [
"MIT"
] | null | null | null | django/zapier.py | Zadigo/django_api | 6dcc54590563f10c1af07d1732f80a33183e99b1 | [
"MIT"
] | null | null | null | django/zapier.py | Zadigo/django_api | 6dcc54590563f10c1af07d1732f80a33183e99b1 | [
"MIT"
] | null | null | null | import requests
| 25.25 | 50 | 0.628713 | import requests
class Zapier:
def __init__(self, url, **kwargs):
response = requests.post(url, data=kwargs)
if response.status_code == 200:
self.response = response
class Slack(Zapier):
def __init__(self, url, **kwargs):
super().__init__(url, **kwargs)
class MailChimp(Zapi... | 247 | -6 | 147 |
3718ceab5f222f8bca69a426afe8d8811525e688 | 728 | py | Python | Practical/Easy/PDF Tagger/pdftag.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | 1 | 2022-03-16T16:47:22.000Z | 2022-03-16T16:47:22.000Z | Practical/Easy/PDF Tagger/pdftag.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | null | null | null | Practical/Easy/PDF Tagger/pdftag.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | 2 | 2022-02-02T18:02:03.000Z | 2022-03-16T16:47:34.000Z | from PyPDF3 import PdfFileReader, PdfFileWriter
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
path = filedialog.askopenfilename()
file = open(path, "rb")
pdf = PdfFileReader(file)
writer = PdfFileWriter()
writer.appendPagesFromReader(pdf)
metadata = pdf.getDocumentInfo()
writer.a... | 24.266667 | 60 | 0.726648 | from PyPDF3 import PdfFileReader, PdfFileWriter
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
path = filedialog.askopenfilename()
file = open(path, "rb")
pdf = PdfFileReader(file)
writer = PdfFileWriter()
writer.appendPagesFromReader(pdf)
metadata = pdf.getDocumentInfo()
writer.a... | 0 | 0 | 0 |
65d3463171f37dd00804e5c05b52f1171ac471b8 | 3,529 | py | Python | dvmvs/losses.py | hashi0203/deep-video-mvs | b3943a9249d522dca3e6cd603e427f611cc7bad5 | [
"MIT"
] | 1 | 2022-01-10T07:51:41.000Z | 2022-01-10T07:51:41.000Z | dvmvs/losses.py | MorchelPeng/deep-video-mvs | fa14288f149c5af7b2a49092f729f5c4f44517ba | [
"MIT"
] | null | null | null | dvmvs/losses.py | MorchelPeng/deep-video-mvs | fa14288f149c5af7b2a49092f729f5c4f44517ba | [
"MIT"
] | null | null | null | from __future__ import division
import torch
from torch import nn
| 42.518072 | 146 | 0.676679 | from __future__ import division
import torch
from torch import nn
class LossMeter(object):
def __init__(self):
self.count = 0.0
self.sum = 0.0
self.avg = 0.0
self.item_average = 0.0
def update(self, loss, count):
self.sum += loss
self.count += count
s... | 3,307 | 3 | 149 |
019a6dca1b77aa78438a09bb38052b4373c21627 | 3,130 | py | Python | danceschool/prerequisites/migrations/0002_auto_20170717_1642.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 32 | 2017-09-12T04:25:25.000Z | 2022-03-21T10:48:07.000Z | danceschool/prerequisites/migrations/0002_auto_20170717_1642.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 97 | 2017-09-01T02:43:08.000Z | 2022-01-03T18:20:34.000Z | danceschool/prerequisites/migrations/0002_auto_20170717_1642.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 19 | 2017-09-26T13:34:46.000Z | 2022-03-21T10:48:10.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-17 16:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| 45.362319 | 240 | 0.652716 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-17 16:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('prerequisites', '0001_initial'),
]
operations = [
... | 0 | 2,918 | 23 |
982f5345005882e6c562f6fb5bcbc6a019db11fb | 25,941 | py | Python | api/views.py | 404-wave/404-project | 3ee2ca672e4a69f91c997a8988904481e26b3263 | [
"Apache-2.0"
] | 2 | 2019-03-15T17:34:03.000Z | 2019-03-24T21:39:45.000Z | api/views.py | 404-wave/404-project | 3ee2ca672e4a69f91c997a8988904481e26b3263 | [
"Apache-2.0"
] | 11 | 2019-02-14T03:14:49.000Z | 2022-01-13T01:03:59.000Z | api/views.py | 404-wave/404-project | 3ee2ca672e4a69f91c997a8988904481e26b3263 | [
"Apache-2.0"
] | 5 | 2019-01-26T01:52:10.000Z | 2019-05-01T23:12:27.000Z | from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from django.utils import timezone
from rest_framework import pagination, generics, views, status, mixins
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.parsers import JSONPar... | 36.691655 | 156 | 0.600709 | from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from django.utils import timezone
from rest_framework import pagination, generics, views, status, mixins
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.parsers import JSONPar... | 22,740 | 1,750 | 205 |
f464e613bec0e28c7e2ce25f551d6b2c531780d5 | 9,286 | py | Python | solvers/solver2.py | sberbank-ai/combined_solution_aij2019 | fb194595adddae2d96141c4c6d1bbb3f3e20994e | [
"MIT"
] | 15 | 2019-12-19T07:36:09.000Z | 2022-01-27T03:27:55.000Z | solvers/solver2.py | sberbank-ai/combined_solution_aij2019 | fb194595adddae2d96141c4c6d1bbb3f3e20994e | [
"MIT"
] | 1 | 2021-06-02T00:47:53.000Z | 2021-06-02T00:47:53.000Z | solvers/solver2.py | sberbank-ai/combined_solution_aij2019 | fb194595adddae2d96141c4c6d1bbb3f3e20994e | [
"MIT"
] | 5 | 2019-12-19T12:00:15.000Z | 2021-02-19T15:28:14.000Z | # niw
import re
from nltk.tokenize import sent_tokenize
from string import punctuation
from solvers.solver_helpers import RubertForMasking, AbstractSolver
| 40.907489 | 88 | 0.507646 | # niw
import re
from nltk.tokenize import sent_tokenize
from string import punctuation
from solvers.solver_helpers import RubertForMasking, AbstractSolver
class Solver(AbstractSolver):
def __init__(self):
self.dictionary_words = {}
self.rubert = RubertForMasking()
@staticmethod
def get_... | 10,005 | 160 | 23 |
90b585c2bf8cc577c1f63e619b6ae4ba043de9c5 | 7,494 | py | Python | fintool/transac.py | soote1/fintool | 2cac345a5f10cc1aea3c748b8b68cf9667ae2536 | [
"MIT"
] | null | null | null | fintool/transac.py | soote1/fintool | 2cac345a5f10cc1aea3c748b8b68cf9667ae2536 | [
"MIT"
] | null | null | null | fintool/transac.py | soote1/fintool | 2cac345a5f10cc1aea3c748b8b68cf9667ae2536 | [
"MIT"
] | null | null | null | """
This module provides classes to create and manage transactions.
"""
import uuid
import datetime
from fintool.db import DbFactory
from fintool.logging import LoggingHelper
class Error(Exception):
"""Base class for all errors in this module.
"""
class MissingFieldError(Error):
"""
Raised when t... | 29.388235 | 81 | 0.571257 | """
This module provides classes to create and manage transactions.
"""
import uuid
import datetime
from fintool.db import DbFactory
from fintool.logging import LoggingHelper
class Error(Exception):
"""Base class for all errors in this module.
"""
class MissingFieldError(Error):
"""
Raised when t... | 0 | 0 | 0 |
88f9176b4084dd24c8d1ae30cf04843577596a06 | 3,766 | py | Python | algoplex/api/simulator/exchange_access_sim.py | dmitryaleks/algo-plex | c83421642fc1ac11e558126ec73909b175b07862 | [
"BSD-2-Clause"
] | null | null | null | algoplex/api/simulator/exchange_access_sim.py | dmitryaleks/algo-plex | c83421642fc1ac11e558126ec73909b175b07862 | [
"BSD-2-Clause"
] | null | null | null | algoplex/api/simulator/exchange_access_sim.py | dmitryaleks/algo-plex | c83421642fc1ac11e558126ec73909b175b07862 | [
"BSD-2-Clause"
] | null | null | null | from algoplex.api.common.exchange_access import ExchangeAccess
from algoplex.api.common.maket_data_subscriber import MarketDataSubscriber
from algoplex.api.order import Order
from algoplex.api.execution import Execution
import time
| 34.550459 | 95 | 0.634891 | from algoplex.api.common.exchange_access import ExchangeAccess
from algoplex.api.common.maket_data_subscriber import MarketDataSubscriber
from algoplex.api.order import Order
from algoplex.api.execution import Execution
import time
class ExchangeAccessSim(ExchangeAccess, MarketDataSubscriber):
def __init__(self, ... | 3,064 | 41 | 428 |
835800143623e0650e02ef3e055aacc0644aa157 | 1,542 | py | Python | tests/vector/test_conversion.py | luyang1210/EO | 06656bcfbd08878971543b8f54a97ca34d2f988d | [
"MIT"
] | 17 | 2019-01-14T10:02:55.000Z | 2021-11-20T10:13:26.000Z | tests/vector/test_conversion.py | luyang1210/EO | 06656bcfbd08878971543b8f54a97ca34d2f988d | [
"MIT"
] | 19 | 2019-01-10T19:42:11.000Z | 2021-05-20T20:17:13.000Z | tests/vector/test_conversion.py | luyang1210/EO | 06656bcfbd08878971543b8f54a97ca34d2f988d | [
"MIT"
] | 3 | 2019-01-27T14:45:30.000Z | 2022-01-26T11:50:57.000Z | import pytest
import fnmatch
import os
from pathlib import Path
from eobox.sampledata import get_dataset
from eobox.vector import convert_polygons_to_lines
from eobox.vector import calc_distance_to_border
@pytest.fixture
| 34.266667 | 102 | 0.655642 | import pytest
import fnmatch
import os
from pathlib import Path
from eobox.sampledata import get_dataset
from eobox.vector import convert_polygons_to_lines
from eobox.vector import calc_distance_to_border
@pytest.fixture
def testdata_1(tmpdir):
ds = get_dataset('s2l1c')
tmp_procdir = tmpdir.mkdir("temp_pr... | 1,247 | 0 | 68 |
817239480246feaf671da5f4c699b449a69da468 | 509 | py | Python | Scope.py | Nikuchan/FILES-AND-OOP | 2ef1f370c08ec47054f1c7efd374281d628e70a4 | [
"MIT"
] | null | null | null | Scope.py | Nikuchan/FILES-AND-OOP | 2ef1f370c08ec47054f1c7efd374281d628e70a4 | [
"MIT"
] | null | null | null | Scope.py | Nikuchan/FILES-AND-OOP | 2ef1f370c08ec47054f1c7efd374281d628e70a4 | [
"MIT"
] | null | null | null | #x= 'Global x'
print("\nTesting Global and Local Scope")
test()
print(x)
m=min([3,4,5,6])
print(m)
print("\nTesting Enclosing Scope")
outer() | 18.851852 | 99 | 0.616896 | #x= 'Global x'
print("\nTesting Global and Local Scope")
def test():
global x #Explicitly telling python that we want to work on Global x Variable
#y='Local y'
x='Local x'
#print(y)
print(x)
test()
print(x)
m=min([3,4,5,6])
print(m)
print("\nTesting Enclosing Scope")
def outer():
x='outer x'
... | 321 | 0 | 44 |
86bf2fd58db454b1efa2802cd8ef742a11b11145 | 1,997 | py | Python | tests/integration/lib/api_session.py | afharo/elastic-stack-testing | 3aea11ea4627dc20a0578408191961ff11b5aa0b | [
"Apache-2.0"
] | 44 | 2018-03-10T19:43:47.000Z | 2022-03-13T09:41:56.000Z | tests/integration/lib/api_session.py | afharo/elastic-stack-testing | 3aea11ea4627dc20a0578408191961ff11b5aa0b | [
"Apache-2.0"
] | 144 | 2018-03-09T21:44:03.000Z | 2022-03-31T23:21:12.000Z | tests/integration/lib/api_session.py | afharo/elastic-stack-testing | 3aea11ea4627dc20a0578408191961ff11b5aa0b | [
"Apache-2.0"
] | 32 | 2018-03-06T19:56:47.000Z | 2021-11-03T11:27:27.000Z | '''
Created on Sep 29, 2017
@author: Liza Dayoub
'''
import requests
from requests.packages.urllib3 import disable_warnings
from requests.packages.urllib3.exceptions import InsecureRequestWarning
class ApiSession(object):
'''
classdocs
'''
def __init__(self, **kwargs):
'''
Construct... | 28.942029 | 71 | 0.604907 | '''
Created on Sep 29, 2017
@author: Liza Dayoub
'''
import requests
from requests.packages.urllib3 import disable_warnings
from requests.packages.urllib3.exceptions import InsecureRequestWarning
class ApiSession(object):
'''
classdocs
'''
def __init__(self, **kwargs):
'''
Construct... | 588 | 0 | 135 |
a41986a3ad2c39eeecf7f10cff6c74cfbd02ef8f | 809 | py | Python | day10/day10_a.py | AdamKinnell/AdventOfCode2017 | 28f506a39245198489d3da9535b190e6f98e92d1 | [
"MIT"
] | null | null | null | day10/day10_a.py | AdamKinnell/AdventOfCode2017 | 28f506a39245198489d3da9535b190e6f98e92d1 | [
"MIT"
] | null | null | null | day10/day10_a.py | AdamKinnell/AdventOfCode2017 | 28f506a39245198489d3da9535b190e6f98e92d1 | [
"MIT"
] | null | null | null |
# Entry Point #######################################################
lengths = list(map(int, open('day10.txt').read().split(',')))
string = hash(256, lengths)
print(string[0] * string[1]) # = 46600
| 25.28125 | 69 | 0.584672 |
def reverse_elements(lst, start_i, count):
to_end = min(len(lst) - start_i, count)
from_start = count - to_end
elements = lst[start_i:start_i+to_end]
elements += lst[0:from_start]
elements = list(reversed(elements))
lst[start_i:start_i+to_end] = elements[:to_end]
lst[0:from_start] = elemen... | 561 | 0 | 46 |
07cff5e353a948792c97d517dfb2d1b12e9696ae | 1,641 | py | Python | scripts/src/tools/validation.py | sujith-mn/cobigen | aaf4cd8b9efbc613df3aab8df4c9a39bea2a3851 | [
"Apache-2.0"
] | null | null | null | scripts/src/tools/validation.py | sujith-mn/cobigen | aaf4cd8b9efbc613df3aab8df4c9a39bea2a3851 | [
"Apache-2.0"
] | null | null | null | scripts/src/tools/validation.py | sujith-mn/cobigen | aaf4cd8b9efbc613df3aab8df4c9a39bea2a3851 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
import sys
import git
from tools.config import Config
from tools.logger import log_error, log_info
def exit_if_not_executed_in_ide_environment():
'''This part checks if environment variables is set or not.'''
if not ("OSSRH_USER" and "OSSRH_PASSWD" and "GPG_SIGNING_PASSWD" and "B... | 36.466667 | 196 | 0.697136 | import os
import subprocess
import sys
import git
from tools.config import Config
from tools.logger import log_error, log_info
def exit_if_not_executed_in_ide_environment():
'''This part checks if environment variables is set or not.'''
if not ("OSSRH_USER" and "OSSRH_PASSWD" and "GPG_SIGNING_PASSWD" and "B... | 521 | 0 | 46 |
7c61c9f277706431518e5fec71389da38668f300 | 1,743 | py | Python | server.py | mfojtak/decor | 203979351635a6794c91200fca4a14296ec9bc37 | [
"MIT"
] | 1 | 2019-09-05T07:23:19.000Z | 2019-09-05T07:23:19.000Z | server.py | mfojtak/decor | 203979351635a6794c91200fca4a14296ec9bc37 | [
"MIT"
] | 2 | 2020-10-25T17:41:08.000Z | 2020-10-26T16:48:19.000Z | server.py | mfojtak/deco | 203979351635a6794c91200fca4a14296ec9bc37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from flask import Flask, request, jsonify
import numpy as np
import deco
import requests
import csv
import json
import argparse
parser = argparse.ArgumentParser(description='Exports keras model to serving format')
parser.add_argument('--port', action="store", dest="port", default=4000)
parser.add... | 32.886792 | 96 | 0.688468 | #!/usr/bin/env python
from flask import Flask, request, jsonify
import numpy as np
import deco
import requests
import csv
import json
import argparse
parser = argparse.ArgumentParser(description='Exports keras model to serving format')
parser.add_argument('--port', action="store", dest="port", default=4000)
parser.add... | 715 | 0 | 68 |
abcccc4acff4d48a1d8fcdc1360e355627a270af | 8,030 | py | Python | logFileReplay-csv/send_csv_data_py3.py | xguoif/InsightAgent | 2bda254a137265965475d2e426ee221e1345868c | [
"Apache-2.0"
] | 22 | 2016-05-10T16:36:15.000Z | 2022-03-28T13:15:35.000Z | logFileReplay-csv/send_csv_data_py3.py | xguoif/InsightAgent | 2bda254a137265965475d2e426ee221e1345868c | [
"Apache-2.0"
] | 33 | 2017-03-25T01:40:12.000Z | 2022-03-22T21:41:26.000Z | logFileReplay-csv/send_csv_data_py3.py | xguoif/InsightAgent | 2bda254a137265965475d2e426ee221e1345868c | [
"Apache-2.0"
] | 131 | 2016-06-09T15:19:26.000Z | 2021-11-30T06:06:21.000Z | import csv
import time
import json
import requests
import urllib3
import importlib
import sys
import copy
import arrow
import os
import pytz
import configparser
MAX_RETRY_NUM = 10
RETRY_WAIT_TIME_IN_SEC = 30
MAX_MESSAGE_LENGTH = 10000
MAX_DATA_SIZE = 4000000
MAX_PACKET_SIZE = 5000000
def send_data(log_data):
""" ... | 39.950249 | 136 | 0.586052 | import csv
import time
import json
import requests
import urllib3
import importlib
import sys
import copy
import arrow
import os
import pytz
import configparser
MAX_RETRY_NUM = 10
RETRY_WAIT_TIME_IN_SEC = 30
MAX_MESSAGE_LENGTH = 10000
MAX_DATA_SIZE = 4000000
MAX_PACKET_SIZE = 5000000
def get_agent_config_vars():
... | 5,026 | 0 | 69 |
4734d9cae5077679d95f3ef88b1e620f5c8e8cc7 | 87 | py | Python | test/e2e/test_zip_download.py | ImageMarkup/isic-archive | 7cd8097886d685ec629e2fcba079271fb77d028f | [
"Apache-2.0"
] | 42 | 2015-12-12T14:05:46.000Z | 2022-03-26T15:20:39.000Z | test/e2e/test_zip_download.py | ImageMarkup/isic-archive | 7cd8097886d685ec629e2fcba079271fb77d028f | [
"Apache-2.0"
] | 494 | 2015-07-09T16:14:12.000Z | 2021-03-09T09:37:36.000Z | test/e2e/test_zip_download.py | ImageMarkup/uda | d221af3368baf3a06ecab67e69e9d0077426c8f9 | [
"Apache-2.0"
] | 12 | 2015-08-20T14:20:48.000Z | 2020-10-20T01:14:44.000Z | import pytest
@pytest.mark.skip('not implemented')
| 12.428571 | 36 | 0.735632 | import pytest
@pytest.mark.skip('not implemented')
def test_zip_download():
pass
| 12 | 0 | 22 |
91621b40b97bb1b107b20ffb1e9e25cd01b5bc07 | 2,355 | py | Python | Basic/fun/function_demo.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | Basic/fun/function_demo.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | 1 | 2018-11-27T09:58:54.000Z | 2018-11-27T09:58:54.000Z | Basic/fun/function_demo.py | exchris/pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | # -*-coding:utf-8 -*-
"""
一个函数包括输入参数和输出参数
"""
# 定义函数
# 调用函数
result = calulus(2)
print(result)
# 参数必须要正确地写入函数中,函数的参数也可以为多个
def fruit_function(fruit1, fruit2):
"""
fruits = fruit1 + " " + fruit2
return fruits
"""
lst = [];
lst.append(fruit1)
lst.append(fruit2)
return lst
# 调用函数
r... | 14.447853 | 62 | 0.534607 | # -*-coding:utf-8 -*-
"""
一个函数包括输入参数和输出参数
"""
# 定义函数
def calulus(x):
y = x + 1
return y
# 调用函数
result = calulus(2)
print(result)
# 参数必须要正确地写入函数中,函数的参数也可以为多个
def fruit_function(fruit1, fruit2):
"""
fruits = fruit1 + " " + fruit2
return fruits
"""
lst = [];
lst.append(fruit1)
l... | 958 | 0 | 289 |
ffedb50a3afe2b393ba4b9035d8d104c2e995b69 | 204 | py | Python | character_sheet/src/player/classes/fighter.py | quintenpalmer/dnd | 0efa2b0ecfe886fde06a07ee5dc9475cd77f63a3 | [
"MIT"
] | 7 | 2016-11-13T18:50:39.000Z | 2021-02-11T01:38:36.000Z | character_sheet/src/player/classes/fighter.py | quintenpalmer/dnd | 0efa2b0ecfe886fde06a07ee5dc9475cd77f63a3 | [
"MIT"
] | null | null | null | character_sheet/src/player/classes/fighter.py | quintenpalmer/dnd | 0efa2b0ecfe886fde06a07ee5dc9475cd77f63a3 | [
"MIT"
] | 2 | 2016-11-04T13:07:58.000Z | 2017-09-22T07:36:20.000Z | from . import class_
| 22.666667 | 47 | 0.642157 | from . import class_
class Fighter(class_.Class):
def __init__(self, fighter_type):
class_.Class.__init__(self)
self.defs['fort'] = 2
self.spec = 'fighter_%s' % fighter_type
| 126 | 7 | 49 |
f734f8778bf4b8e5ff157ae685a7c022d954b83a | 1,502 | py | Python | heat/engine/clients/os/aodh.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:26.000Z | 2018-07-04T07:59:26.000Z | heat/engine/clients/os/aodh.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | heat/engine/clients/os/aodh.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 3 | 2018-07-19T17:43:37.000Z | 2019-11-15T22:13:30.000Z | #
# 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 agreed to in writing, software
# ... | 30.04 | 78 | 0.699734 | #
# 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 agreed to in writing, software
# ... | 478 | 286 | 23 |
30a90bb1b61520bbe62cfd78a265d535fabc87db | 9,827 | py | Python | nmea2kfluxlite/nmea2kfluxlite.py | iotfablab/nmea2kfluxlite | 940160f68cacdee6cd050bd8a63bc77757a67208 | [
"MIT"
] | null | null | null | nmea2kfluxlite/nmea2kfluxlite.py | iotfablab/nmea2kfluxlite | 940160f68cacdee6cd050bd8a63bc77757a67208 | [
"MIT"
] | null | null | null | nmea2kfluxlite/nmea2kfluxlite.py | iotfablab/nmea2kfluxlite | 940160f68cacdee6cd050bd8a63bc77757a67208 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import asyncio
import json
import logging
import os
import socket
import ssl
import sys
import time
from queue import Queue
import paho.mqtt.client as mqtt
SERVER_ADDRESS = ('localhost', 2598)
# Logging Configuration
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
lo... | 39.465863 | 149 | 0.566399 | #!/usr/bin/env python3
import argparse
import asyncio
import json
import logging
import os
import socket
import ssl
import sys
import time
from queue import Queue
import paho.mqtt.client as mqtt
SERVER_ADDRESS = ('localhost', 2598)
# Logging Configuration
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
lo... | 613 | 0 | 23 |
a1b39fcace9b599b3f0e5d9b67a39f6838550bd5 | 6,726 | py | Python | Extracting Targeted Tweets.py | narmin24/UTrack | 68d281bc59b2de52eb769c1fdad39aa94a6c497e | [
"MIT"
] | 4 | 2021-06-14T20:46:08.000Z | 2022-02-14T07:24:14.000Z | Extracting Targeted Tweets.py | narmin24/UTrack | 68d281bc59b2de52eb769c1fdad39aa94a6c497e | [
"MIT"
] | null | null | null | Extracting Targeted Tweets.py | narmin24/UTrack | 68d281bc59b2de52eb769c1fdad39aa94a6c497e | [
"MIT"
] | 5 | 2021-06-14T07:37:06.000Z | 2021-07-06T07:07:14.000Z | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import tweepy
import pandas as pd
import numpy as np
import webbrowser
import time
from tweepy import OAuthHandler
import json
import csv
import re
import string
import os
# In[ ]:
key = "VEyxpXLGHG9USYhM7spHVKl36"
secret = "FG61nlBuLR7mb6UCPGxHH4UdMqwYNwL6aFhDt9gQJ... | 25.869231 | 145 | 0.608683 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import tweepy
import pandas as pd
import numpy as np
import webbrowser
import time
from tweepy import OAuthHandler
import json
import csv
import re
import string
import os
# In[ ]:
key = "VEyxpXLGHG9USYhM7spHVKl36"
secret = "FG61nlBuLR7mb6UCPGxHH4UdMqwYNwL6aFhDt9gQJ... | 3,645 | 0 | 46 |
5f0ad559628e9ed1c7c9a05fb15e31281a2a97e3 | 2,204 | py | Python | src/genie/libs/parser/slxos/tests/ShowVersion/cli/equal/golden_output1_expected.py | fpessoanunes/genieparser | 8597aae1799f8a540214d6dbcfd545d2ebe369e4 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/slxos/tests/ShowVersion/cli/equal/golden_output1_expected.py | fpessoanunes/genieparser | 8597aae1799f8a540214d6dbcfd545d2ebe369e4 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/slxos/tests/ShowVersion/cli/equal/golden_output1_expected.py | fpessoanunes/genieparser | 8597aae1799f8a540214d6dbcfd545d2ebe369e4 | [
"Apache-2.0"
] | null | null | null | expected_output = {
"version": {
"build_time": "08:13:43 Apr 7, 2021",
"firmware_ver": "18r.1.00h",
"install_time": "07:14:32 Jun 1, 2021",
"slot": {
"L1/0": {
"name": "L1/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "... | 31.042254 | 53 | 0.329855 | expected_output = {
"version": {
"build_time": "08:13:43 Apr 7, 2021",
"firmware_ver": "18r.1.00h",
"install_time": "07:14:32 Jun 1, 2021",
"slot": {
"L1/0": {
"name": "L1/0",
"primary_ver": "18r.1.00h",
"secondary_ver": "... | 0 | 0 | 0 |
a0d59839a7d08a190885d346ae18a9e437c405e7 | 39 | py | Python | models/neck/__init__.py | Challenging6/YoloDB | bdc1c4239ec112c21a65df64b9f4dc8447b739fa | [
"MIT"
] | null | null | null | models/neck/__init__.py | Challenging6/YoloDB | bdc1c4239ec112c21a65df64b9f4dc8447b739fa | [
"MIT"
] | null | null | null | models/neck/__init__.py | Challenging6/YoloDB | bdc1c4239ec112c21a65df64b9f4dc8447b739fa | [
"MIT"
] | null | null | null | from .FPN import *
from .PAN import * | 19.5 | 19 | 0.666667 | from .FPN import *
from .PAN import * | 0 | 0 | 0 |
9e96c8bf96a1408e84578c9d71e9a7bf5501c905 | 519 | py | Python | ipster/command_line.py | i5ar/ipster | ec82782e2dafe4ddf4ea70fb554fc7ff5c3f28de | [
"MIT"
] | 4 | 2018-08-13T04:33:32.000Z | 2021-05-24T21:03:09.000Z | ipster/command_line.py | i5ar/ipster | ec82782e2dafe4ddf4ea70fb554fc7ff5c3f28de | [
"MIT"
] | 1 | 2017-10-08T23:45:19.000Z | 2017-10-08T23:45:19.000Z | ipster/command_line.py | i5ar/ipster | ec82782e2dafe4ddf4ea70fb554fc7ff5c3f28de | [
"MIT"
] | null | null | null | def main():
"""Generate reStructuredText README from Markdown.
The ``main()`` function is also registered in the setup entry points.
Convertion example::
import ipster.command_line
ipster.command_line.main()
"""
readme_in = 'README.md'
readme_out = 'README.rst'
try:
... | 25.95 | 73 | 0.622351 | def main():
"""Generate reStructuredText README from Markdown.
The ``main()`` function is also registered in the setup entry points.
Convertion example::
import ipster.command_line
ipster.command_line.main()
"""
readme_in = 'README.md'
readme_out = 'README.rst'
try:
... | 0 | 0 | 0 |
ee4b4c589f802aa2f5083facb8a99d6b6b9cbcf2 | 4,425 | py | Python | src/win_maximize/__init__.py | alkuzad/win-maximize-python | 9098143297d3e026126b0f8dd3e6925539841671 | [
"MIT"
] | 2 | 2018-07-16T01:47:59.000Z | 2021-05-17T05:15:19.000Z | src/win_maximize/__init__.py | alkuzad/win-maximize-python | 9098143297d3e026126b0f8dd3e6925539841671 | [
"MIT"
] | null | null | null | src/win_maximize/__init__.py | alkuzad/win-maximize-python | 9098143297d3e026126b0f8dd3e6925539841671 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Thanks to https://github.com/ritchielawrence/cmdow
# For providing help for treating Win32 API
import re
import os
from argparse import ArgumentParser
import win32gui
import win32api
import win32console
import win32process
from win32com.client import GetObject
from win_maximize.parent_tree ... | 26.981707 | 85 | 0.620791 | #!/usr/bin/env python
# Thanks to https://github.com/ritchielawrence/cmdow
# For providing help for treating Win32 API
import re
import os
from argparse import ArgumentParser
import win32gui
import win32api
import win32console
import win32process
from win32com.client import GetObject
from win_maximize.parent_tree ... | 3,342 | 120 | 459 |
bc9d84411558123a05436a09a0577c76e61e4e5b | 140 | py | Python | scorecard/templatetags/jsonify.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 19 | 2018-01-09T10:54:15.000Z | 2022-01-25T13:10:55.000Z | wazimap/templatetags/jsonify.py | ChrisAchinga/wazimap | a66a1524030a8b98e7ea0dfb270d1946ca75b3b2 | [
"MIT"
] | 66 | 2016-02-15T08:59:29.000Z | 2017-09-21T14:00:43.000Z | wazimap/templatetags/jsonify.py | ChrisAchinga/wazimap | a66a1524030a8b98e7ea0dfb270d1946ca75b3b2 | [
"MIT"
] | 18 | 2017-10-06T12:26:37.000Z | 2021-08-30T01:38:37.000Z | import json
from django import template
register = template.Library()
@register.filter
| 12.727273 | 29 | 0.757143 | import json
from django import template
register = template.Library()
@register.filter
def jsonify(value):
return json.dumps(value)
| 27 | 0 | 22 |
5c14d9e82c29d05157bdb01e42172d98f68b5601 | 73 | py | Python | raccgen/__init__.py | michaelpeterswa/raccgen | 389bcb3c34b137f74b5b7bf6c2e2e07aa77d6feb | [
"MIT"
] | null | null | null | raccgen/__init__.py | michaelpeterswa/raccgen | 389bcb3c34b137f74b5b7bf6c2e2e07aa77d6feb | [
"MIT"
] | null | null | null | raccgen/__init__.py | michaelpeterswa/raccgen | 389bcb3c34b137f74b5b7bf6c2e2e07aa77d6feb | [
"MIT"
] | null | null | null | from raccgen import generate
build = generate.build
pair = generate.racc | 18.25 | 28 | 0.808219 | from raccgen import generate
build = generate.build
pair = generate.racc | 0 | 0 | 0 |
e7ba4f2dc1ca119416d3cf36c7b42ba7a67d180e | 1,632 | py | Python | app/api/models.py | tarp20/testapi | 7109b7189f535d5f983df7f643e6bfe712fff6b1 | [
"MIT"
] | null | null | null | app/api/models.py | tarp20/testapi | 7109b7189f535d5f983df7f643e6bfe712fff6b1 | [
"MIT"
] | null | null | null | app/api/models.py | tarp20/testapi | 7109b7189f535d5f983df7f643e6bfe712fff6b1 | [
"MIT"
] | null | null | null | from django.db import models
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
import uuid
# def validate_color(color):
# match = re.search(r'^#(?:[0-9a-fA-F]{3}){1,2}$', color)
# if match == False:
# raise ValidationError(
# ... | 41.846154 | 113 | 0.509804 | from django.db import models
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
import uuid
# def validate_color(color):
# match = re.search(r'^#(?:[0-9a-fA-F]{3}){1,2}$', color)
# if match == False:
# raise ValidationError(
# ... | 0 | 0 | 0 |
4f8ae9451d8fd3bb3e31eb0b951eb9a25edaf19e | 2,223 | py | Python | wolframclient/language/__init__.py | jldohmann/WolframClientForPython | 15cb8ba21f8a08ab17f041f2cbf46ae165e64004 | [
"MIT"
] | 358 | 2018-10-18T13:39:48.000Z | 2022-03-26T09:42:53.000Z | wolframclient/language/__init__.py | jldohmann/WolframClientForPython | 15cb8ba21f8a08ab17f041f2cbf46ae165e64004 | [
"MIT"
] | 29 | 2018-10-20T09:04:12.000Z | 2022-03-06T18:36:19.000Z | wolframclient/language/__init__.py | jldohmann/WolframClientForPython | 15cb8ba21f8a08ab17f041f2cbf46ae165e64004 | [
"MIT"
] | 38 | 2018-10-19T21:52:14.000Z | 2021-11-21T13:07:04.000Z | from __future__ import absolute_import, print_function, unicode_literals
from wolframclient.language.expression import WLInputExpression, WLSymbolFactory
wl = WLSymbolFactory()
"""A factory of :class:`~wolframclient.language.expression.WLSymbol` instances without any particular context.
This instance of :class:`~wol... | 26.464286 | 110 | 0.732344 | from __future__ import absolute_import, print_function, unicode_literals
from wolframclient.language.expression import WLInputExpression, WLSymbolFactory
wl = WLSymbolFactory()
"""A factory of :class:`~wolframclient.language.expression.WLSymbol` instances without any particular context.
This instance of :class:`~wol... | 0 | 0 | 0 |
4335fd74a1d30b386b6b58de6703bb2e577ebeb5 | 6,482 | py | Python | zerver/tornado/views.py | noabenefraim/zulip | 708b5e12353513911c2cb8cad35db699a48ea860 | [
"Apache-2.0"
] | null | null | null | zerver/tornado/views.py | noabenefraim/zulip | 708b5e12353513911c2cb8cad35db699a48ea860 | [
"Apache-2.0"
] | null | null | null | zerver/tornado/views.py | noabenefraim/zulip | 708b5e12353513911c2cb8cad35db699a48ea860 | [
"Apache-2.0"
] | null | null | null | import time
from typing import Iterable, Optional, Sequence
import orjson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import REQ, has_request_variables, internal_notify_view, process_client
from zerver.lib.response import json_error, json_... | 49.106061 | 118 | 0.644708 | import time
from typing import Iterable, Optional, Sequence
import orjson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import REQ, has_request_variables, internal_notify_view, process_client
from zerver.lib.response import json_error, json_... | 5,493 | 0 | 111 |
cb1b921d4aab5f39482998b9f5ac2b12152dfbff | 803 | py | Python | src/alchemtest/namd/access.py | harlor/alchemtest | 9a126e256d538bcffd0cb4e0ca5bccc60ca3a2ab | [
"BSD-3-Clause"
] | null | null | null | src/alchemtest/namd/access.py | harlor/alchemtest | 9a126e256d538bcffd0cb4e0ca5bccc60ca3a2ab | [
"BSD-3-Clause"
] | null | null | null | src/alchemtest/namd/access.py | harlor/alchemtest | 9a126e256d538bcffd0cb4e0ca5bccc60ca3a2ab | [
"BSD-3-Clause"
] | null | null | null | """Accessors for NAMD FEP datasets.
"""
from os.path import dirname, join
from glob import glob
from .. import Bunch
def load_tyr2ala():
"""Load the NAMD tyrosine to alanine mutation dataset.
Returns
-------
data : Bunch
Dictionary-like object, the interesting attributes are:
- 'da... | 24.333333 | 89 | 0.637609 | """Accessors for NAMD FEP datasets.
"""
from os.path import dirname, join
from glob import glob
from .. import Bunch
def load_tyr2ala():
"""Load the NAMD tyrosine to alanine mutation dataset.
Returns
-------
data : Bunch
Dictionary-like object, the interesting attributes are:
- 'da... | 0 | 0 | 0 |
c421dcaf714881c080bc10b4974cf75fa47ce8fb | 1,441 | py | Python | ta/ex00.py | stormabq/python-examples | 1c1acfc3863a2cf1a9e202c9299f3a526858eb34 | [
"MIT"
] | 1 | 2021-12-12T04:39:53.000Z | 2021-12-12T04:39:53.000Z | ta/ex00.py | stormabq/python-examples | 1c1acfc3863a2cf1a9e202c9299f3a526858eb34 | [
"MIT"
] | null | null | null | ta/ex00.py | stormabq/python-examples | 1c1acfc3863a2cf1a9e202c9299f3a526858eb34 | [
"MIT"
] | 6 | 2020-05-05T17:21:28.000Z | 2021-12-12T04:39:57.000Z | import pandas as pd
import ta
# Load data
df = pd.read_csv('ui.csv', sep=',')
# Clean nan values
df = ta.utils.dropna(df)
print('roc')
print(ta.momentum.roc(close=df['close']),40)
print('-----------------------------------')
print('rsi')
print(ta.momentum.rsi(close=df['close']),14)
print('---------------------------... | 32.75 | 58 | 0.519084 | import pandas as pd
import ta
# Load data
df = pd.read_csv('ui.csv', sep=',')
# Clean nan values
df = ta.utils.dropna(df)
print('roc')
print(ta.momentum.roc(close=df['close']),40)
print('-----------------------------------')
print('rsi')
print(ta.momentum.rsi(close=df['close']),14)
print('---------------------------... | 0 | 0 | 0 |
6769e1e59f92f6cd5ed42e6c26ee0c30a14a3f22 | 172 | py | Python | tempest/lis/core/__init__.py | paulaCrismaru/lis-tempest | 4f142db3967971ee42c4fcff01be363bbdc4bc54 | [
"Apache-2.0"
] | 3 | 2016-07-15T12:27:23.000Z | 2021-04-23T04:41:10.000Z | tempest/lis/core/__init__.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | null | null | null | tempest/lis/core/__init__.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | 12 | 2016-07-14T18:13:05.000Z | 2017-07-08T18:45:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: dpaslaru
# @Date: 2014-09-17 18:36:03
# @Last Modified by: dpaslaru
# @Last Modified time: 2014-09-17 19:40:59
| 24.571429 | 42 | 0.633721 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: dpaslaru
# @Date: 2014-09-17 18:36:03
# @Last Modified by: dpaslaru
# @Last Modified time: 2014-09-17 19:40:59
| 0 | 0 | 0 |
70900508a650ccd05650ec5b2b46870f0bbe66a7 | 16,187 | py | Python | includes/snv-indels/scripts/vcf2json.py | Miachol/hamlet | 86c180179053be624b572a0cc1e53769835eb298 | [
"MIT"
] | 3 | 2020-08-03T20:35:40.000Z | 2020-11-19T05:42:16.000Z | includes/snv-indels/scripts/vcf2json.py | Miachol/hamlet | 86c180179053be624b572a0cc1e53769835eb298 | [
"MIT"
] | 16 | 2020-06-05T17:12:16.000Z | 2022-02-16T13:30:09.000Z | includes/snv-indels/scripts/vcf2json.py | Miachol/hamlet | 86c180179053be624b572a0cc1e53769835eb298 | [
"MIT"
] | 2 | 2020-12-07T08:04:07.000Z | 2021-12-26T04:01:51.000Z | #!/usr/bin/env python3
"""
Script for extracting a JSON payload for plotting from VarScan VCF files
annotated with VEP.
Only samples with calls are returned.
If a file containing Ensembl IDs (one per line) is supplied, only records
associated with the IDs are returned.
Requirements:
* Python 3.x
* PyVCF 0.6... | 37.731935 | 79 | 0.587756 | #!/usr/bin/env python3
"""
Script for extracting a JSON payload for plotting from VarScan VCF files
annotated with VEP.
Only samples with calls are returned.
If a file containing Ensembl IDs (one per line) is supplied, only records
associated with the IDs are returned.
Requirements:
* Python 3.x
* PyVCF 0.6... | 3,848 | 0 | 126 |
47d67142613ed882df35f538e398488908619d7e | 2,487 | py | Python | simuvex/procedures/cgc/receive.py | praetorian-inc/simuvex | 7984bc4432a1c2126e6f2eb963c935e9f6a98da5 | [
"BSD-2-Clause"
] | 8 | 2016-01-19T03:13:32.000Z | 2020-11-03T09:30:05.000Z | simuvex/procedures/cgc/receive.py | praetorian-inc/simuvex | 7984bc4432a1c2126e6f2eb963c935e9f6a98da5 | [
"BSD-2-Clause"
] | null | null | null | simuvex/procedures/cgc/receive.py | praetorian-inc/simuvex | 7984bc4432a1c2126e6f2eb963c935e9f6a98da5 | [
"BSD-2-Clause"
] | 3 | 2017-04-24T00:22:30.000Z | 2020-11-03T09:30:06.000Z | import simuvex
from itertools import count
fastpath_data_counter = count()
#pylint:disable=arguments-differ
from simuvex.s_options import ABSTRACT_MEMORY, CGC_NO_SYMBOLIC_RECEIVE_LENGTH
| 42.87931 | 109 | 0.593486 | import simuvex
from itertools import count
fastpath_data_counter = count()
class receive(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, fd, buf, count, rx_bytes):
if self.state.mode == 'fastpath':
# Special case for CFG generation
if not self.state.se.s... | 2,230 | 15 | 50 |
48e0c754ff8bfff8020c330d75e068d0bec374f6 | 871 | py | Python | perif.py | AlanTurist/Prefecture_Greece_covid19 | 1879080428c749a1df0e1e26f7f540e31ef0a01b | [
"MIT"
] | 1 | 2020-04-15T10:22:49.000Z | 2020-04-15T10:22:49.000Z | perif.py | AlanTurist/Prefecture_Greece_covid19 | 1879080428c749a1df0e1e26f7f540e31ef0a01b | [
"MIT"
] | null | null | null | perif.py | AlanTurist/Prefecture_Greece_covid19 | 1879080428c749a1df0e1e26f7f540e31ef0a01b | [
"MIT"
] | null | null | null | import datetime
data = datetime.datetime.now()
data1 = data.strftime("%d-%m-%Y %H:%M:%S")
import pandas as pd
url = 'https://raw.githubusercontent.com/AlanTurist/Greece_covid19/master/region_greece.csv'
df = pd.read_csv(url,index_col=0, sep=",") | 33.5 | 92 | 0.603904 | import datetime
data = datetime.datetime.now()
data1 = data.strftime("%d-%m-%Y %H:%M:%S")
import pandas as pd
url = 'https://raw.githubusercontent.com/AlanTurist/Greece_covid19/master/region_greece.csv'
df = pd.read_csv(url,index_col=0, sep=",")
def regione(reg, x, y):
reg1 = df.iloc[x]
D1 = reg1['CASES']
... | 731 | 0 | 23 |