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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12a3e9e2ed005fc61135a10c0c22b0d343853afc | 393 | py | Python | src/drf_cloudstorage/__init__.py | inabhi9/drf-cloudstorage | 7f5e1b1e721208c5682f1f1e443a13af73d039bc | [
"MIT"
] | null | null | null | src/drf_cloudstorage/__init__.py | inabhi9/drf-cloudstorage | 7f5e1b1e721208c5682f1f1e443a13af73d039bc | [
"MIT"
] | null | null | null | src/drf_cloudstorage/__init__.py | inabhi9/drf-cloudstorage | 7f5e1b1e721208c5682f1f1e443a13af73d039bc | [
"MIT"
] | null | null | null | import logging
import cloudinary
from django.conf import settings
L = logging.getLogger(__name__)
try:
cloudinary.config(
cloud_name=settings.CLOUDINARY_NAME,
api_key=settings.CLOUDINARY_API_KEY,
api_secret=settings.CLOUDINARY_API_SECRET
)
except AttributeError:
L.warning('Cloudin... | 24.5625 | 94 | 0.763359 | import logging
import cloudinary
from django.conf import settings
L = logging.getLogger(__name__)
try:
cloudinary.config(
cloud_name=settings.CLOUDINARY_NAME,
api_key=settings.CLOUDINARY_API_KEY,
api_secret=settings.CLOUDINARY_API_SECRET
)
except AttributeError:
L.warning('Cloudin... | 0 | 0 | 0 |
94e1a59c4ea87e514a8b6e9576d3cd0c95da648d | 457 | py | Python | setup.py | BerenMillidge/inferactively | 110ba5f01c1c302ecde40b4d7e555d1da535e372 | [
"MIT"
] | null | null | null | setup.py | BerenMillidge/inferactively | 110ba5f01c1c302ecde40b4d7e555d1da535e372 | [
"MIT"
] | null | null | null | setup.py | BerenMillidge/inferactively | 110ba5f01c1c302ecde40b4d7e555d1da535e372 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name="inferactively",
version="0.0.1",
description=(
"A Python implementation of active inference for Markov Decision Processes"
),
license="Apache 2.0",
url="https://github.com/alec-tschantz/infer-actively",
packages=[
"inferactively",
... | 24.052632 | 83 | 0.632385 | import setuptools
setuptools.setup(
name="inferactively",
version="0.0.1",
description=(
"A Python implementation of active inference for Markov Decision Processes"
),
license="Apache 2.0",
url="https://github.com/alec-tschantz/infer-actively",
packages=[
"inferactively",
... | 0 | 0 | 0 |
71cf20761dbf0ecb5aa2cee2d51db791bf3fe7eb | 1,461 | py | Python | plantara/contrib/plants/migrations/0001_initial.py | plantara/plantara-backend | 3e3cf1f7aa83a124b7e1b616e44aa1f31333598e | [
"MIT"
] | null | null | null | plantara/contrib/plants/migrations/0001_initial.py | plantara/plantara-backend | 3e3cf1f7aa83a124b7e1b616e44aa1f31333598e | [
"MIT"
] | null | null | null | plantara/contrib/plants/migrations/0001_initial.py | plantara/plantara-backend | 3e3cf1f7aa83a124b7e1b616e44aa1f31333598e | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-17 16:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
| 39.486486 | 142 | 0.622861 | # Generated by Django 3.2.8 on 2021-10-17 16:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 0 | 1,269 | 23 |
d7bad8d7b546c1b3362cdd49974c49611166bb1e | 1,039 | py | Python | AvailabilityMonitor/DbAccess/dbaccesser.py | jinhong666/Python | b945759a1acf55cc8546f94618d46040455de422 | [
"Apache-2.0"
] | null | null | null | AvailabilityMonitor/DbAccess/dbaccesser.py | jinhong666/Python | b945759a1acf55cc8546f94618d46040455de422 | [
"Apache-2.0"
] | null | null | null | AvailabilityMonitor/DbAccess/dbaccesser.py | jinhong666/Python | b945759a1acf55cc8546f94618d46040455de422 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from Tools.datetimetool import DateTimeTool
import logging
from DbAccess import DBHelper
SOCKET_TIMEOUT = 1
| 33.516129 | 116 | 0.666025 | #!/usr/bin/python
from Tools.datetimetool import DateTimeTool
import logging
from DbAccess import DBHelper
SOCKET_TIMEOUT = 1
class DbAccesser:
def __init__(self,host,user,pwd,db):
self._dbHelper = DBHelper(host,user,pwd,db)
self._logger = logging.getLogger("root")
def RecordMonitor(self,do... | 844 | -4 | 103 |
afdd8188bebf224706ecf8d027918397f38f1e8a | 500 | py | Python | sphinx/source/docs/user_guide/examples/styling_math_text_latex_axis_labels_titles_labels.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | 1 | 2020-05-26T15:21:22.000Z | 2020-05-26T15:21:22.000Z | sphinx/source/docs/user_guide/examples/styling_math_text_latex_axis_labels_titles_labels.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T17:32:31.000Z | 2021-12-21T18:11:05.000Z | sphinx/source/docs/user_guide/examples/styling_math_text_latex_axis_labels_titles_labels.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | 1 | 2021-12-20T05:50:00.000Z | 2021-12-20T05:50:00.000Z | from numpy import arange, pi, sin
from bokeh.models.annotations.labels import Label
from bokeh.plotting import figure, show
x = arange(-2*pi, 2*pi, 0.1)
y = sin(x)
p = figure(height=250, title=r"\[\sin(x)\text{ for }x\text{ between }-2\pi\text{ and }2\pi\]")
p.circle(x, y, alpha=0.6, size=7)
label = Label(
text... | 21.73913 | 94 | 0.632 | from numpy import arange, pi, sin
from bokeh.models.annotations.labels import Label
from bokeh.plotting import figure, show
x = arange(-2*pi, 2*pi, 0.1)
y = sin(x)
p = figure(height=250, title=r"\[\sin(x)\text{ for }x\text{ between }-2\pi\text{ and }2\pi\]")
p.circle(x, y, alpha=0.6, size=7)
label = Label(
text... | 0 | 0 | 0 |
4760af4a55c71b0ac95f5803594db575b2cd9908 | 1,188 | py | Python | getpaid_payu/views.py | prog32/django-getpaid-payu | 1fedaa252b006d6543027a41bf791302bb7bc729 | [
"MIT"
] | null | null | null | getpaid_payu/views.py | prog32/django-getpaid-payu | 1fedaa252b006d6543027a41bf791302bb7bc729 | [
"MIT"
] | null | null | null | getpaid_payu/views.py | prog32/django-getpaid-payu | 1fedaa252b006d6543027a41bf791302bb7bc729 | [
"MIT"
] | null | null | null | import json
import logging
import swapper
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from .processor import PaymentProcessor
logger = logging.getLogger(__name__)
@method_deco... | 30.461538 | 81 | 0.689394 | import json
import logging
import swapper
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from .processor import PaymentProcessor
logger = logging.getLogger(__name__)
@method_deco... | 681 | 0 | 27 |
9c7d8a845eefe61b5878d6b85fff302cd41bfe13 | 4,597 | py | Python | gtpython/gt/annotationsketch/feature_index.py | jamescasbon/genometools | 1187295df99c67f7083a2f4ed6bd39bfbdf1a7be | [
"MIT"
] | 2 | 2018-06-04T01:11:02.000Z | 2018-11-30T20:04:01.000Z | gtpython/gt/annotationsketch/feature_index.py | jamescasbon/genometools | 1187295df99c67f7083a2f4ed6bd39bfbdf1a7be | [
"MIT"
] | null | null | null | gtpython/gt/annotationsketch/feature_index.py | jamescasbon/genometools | 1187295df99c67f7083a2f4ed6bd39bfbdf1a7be | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
# Copyright (c) 2008 Center for Bioinformatics, University of Hamburg
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that ... | 35.091603 | 75 | 0.667174 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
# Copyright (c) 2008 Center for Bioinformatics, University of Hamburg
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that ... | 2,959 | 462 | 46 |
bd1ac8b4ad4b032a01ce76b80fa324a7c44d8ffc | 4,171 | py | Python | sim_companies_scrapper_main.py | sparx058/simcompanies_basic_scrapper | fc68dae225f18acc5453c23ca48001a95fdc8eb1 | [
"MIT"
] | 1 | 2021-02-02T17:19:15.000Z | 2021-02-02T17:19:15.000Z | sim_companies_scrapper_main.py | sparx058/simcompanies_basic_scrapper | fc68dae225f18acc5453c23ca48001a95fdc8eb1 | [
"MIT"
] | null | null | null | sim_companies_scrapper_main.py | sparx058/simcompanies_basic_scrapper | fc68dae225f18acc5453c23ca48001a95fdc8eb1 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup as bs
import requests, json, pprint, pandas, csv, time
import psutil, asyncio, aiohttp
start_time = time.time()
headers = { # First line of defense
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Conten... | 44.37234 | 108 | 0.536322 | from bs4 import BeautifulSoup as bs
import requests, json, pprint, pandas, csv, time
import psutil, asyncio, aiohttp
start_time = time.time()
def string_to_json_print(st):
json_soup = json.loads(st)
pprint.pprint(json_soup)
headers = { # First line of defense
'Access-Control-Allow-Origin'... | 2,177 | 0 | 50 |
cb5295dbb2a1091ac28dd9666b172470e520049e | 592 | py | Python | skroute/datasets/__init__.py | arubiales/scikit-route | 83262d9d41ff700c911927f5bb6c93feb0c595e4 | [
"MIT"
] | 2 | 2020-12-30T19:01:08.000Z | 2022-01-17T09:50:59.000Z | skroute/datasets/__init__.py | arubiales/scikit-route | 83262d9d41ff700c911927f5bb6c93feb0c595e4 | [
"MIT"
] | 39 | 2020-12-30T14:58:45.000Z | 2021-06-21T20:50:02.000Z | skroute/datasets/__init__.py | arubiales/scikit-route | 83262d9d41ff700c911927f5bb6c93feb0c595e4 | [
"MIT"
] | 1 | 2020-12-31T00:41:10.000Z | 2020-12-31T00:41:10.000Z | import pandas as pd
from ._datasets import *
__all__ = [
"load_alicante_murcia", "load_barcelona", "load_madrid", "load_valencia"
"load_argentina", "load_burma", "load_china", "load_canada",
"load_djibouti", "load_egypt", "load_ireland", "load_finland",
"load_greece", "load_honduras", "load_italy", "lo... | 42.285714 | 81 | 0.701014 | import pandas as pd
from ._datasets import *
__all__ = [
"load_alicante_murcia", "load_barcelona", "load_madrid", "load_valencia"
"load_argentina", "load_burma", "load_china", "load_canada",
"load_djibouti", "load_egypt", "load_ireland", "load_finland",
"load_greece", "load_honduras", "load_italy", "lo... | 0 | 0 | 0 |
ed8a83062f427c815e3aceb1ae17bf5f41b97821 | 641 | py | Python | drupal_dockerizer/dockerizer.py | jet-dev-team/drupal-dockerizer-cli | 5fd5533459e49a3c580f6115f2d7fd1074fa29aa | [
"MIT"
] | null | null | null | drupal_dockerizer/dockerizer.py | jet-dev-team/drupal-dockerizer-cli | 5fd5533459e49a3c580f6115f2d7fd1074fa29aa | [
"MIT"
] | null | null | null | drupal_dockerizer/dockerizer.py | jet-dev-team/drupal-dockerizer-cli | 5fd5533459e49a3c580f6115f2d7fd1074fa29aa | [
"MIT"
] | null | null | null | import requests
import os
import shutil
from zipfile import ZipFile
| 32.05 | 92 | 0.694228 | import requests
import os
import shutil
from zipfile import ZipFile
def initRepository(tag):
url = f"https://codeload.github.com/jet-dev-team/drupal-dockerizer/zip/refs/heads/{tag}"
r = requests.get(url)
with open("drupal_dockerizer.zip", "wb") as code:
code.write(r.content)
with ZipFile("drupa... | 549 | 0 | 23 |
14b018be633387b8e048e3e985762dd942129231 | 499 | py | Python | rishabh/heat_map.py | nishantsinghdev/smartdata | e4a9799c76da4230e8d4edbb2e04c2a48eaa20df | [
"MIT"
] | null | null | null | rishabh/heat_map.py | nishantsinghdev/smartdata | e4a9799c76da4230e8d4edbb2e04c2a48eaa20df | [
"MIT"
] | null | null | null | rishabh/heat_map.py | nishantsinghdev/smartdata | e4a9799c76da4230e8d4edbb2e04c2a48eaa20df | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[3]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
get_ipython().magic('matplotlib inline')
heat_map(filepath)
| 17.821429 | 50 | 0.689379 |
# coding: utf-8
# In[3]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
get_ipython().magic('matplotlib inline')
def heat_map(filepath):
sep=','
df = pd.read_csv(filepath,sep,index_col=False)
#get only the numeric values of dataframe
pp=df._get_numeri... | 293 | 0 | 23 |
a9a7c2dfde259c282dcf86e8f4a3900fab7f72a5 | 23,874 | py | Python | djredcap/management/subcommands/djfixture.py | swanijam/django-redcap | 321456506ec4aaf2aff48e99418bcc8ce0f3b383 | [
"BSD-3-Clause"
] | null | null | null | djredcap/management/subcommands/djfixture.py | swanijam/django-redcap | 321456506ec4aaf2aff48e99418bcc8ce0f3b383 | [
"BSD-3-Clause"
] | null | null | null | djredcap/management/subcommands/djfixture.py | swanijam/django-redcap | 321456506ec4aaf2aff48e99418bcc8ce0f3b383 | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
import csv
import json
import re
import math
from decimal import Decimal
from django.core.management.base import BaseCommand, CommandError
field_types = {
'date_ymd': 'DateField',
'number': 'FloatField',
'integer': 'IntegerField',
'email': 'EmailField',
'text': 'C... | 42.861759 | 80 | 0.479811 | import sys
import os
import csv
import json
import re
import math
from decimal import Decimal
from django.core.management.base import BaseCommand, CommandError
field_types = {
'date_ymd': 'DateField',
'number': 'FloatField',
'integer': 'IntegerField',
'email': 'EmailField',
'text': 'C... | 6,195 | 0 | 50 |
722e045cf49bbb761f785ffad1cf69df118ec4de | 57 | py | Python | server/database_schemas/__init__.py | kaheicanaan/muffin | 38a635e861fb1e643fe6c4b369e93722242b29da | [
"MIT"
] | null | null | null | server/database_schemas/__init__.py | kaheicanaan/muffin | 38a635e861fb1e643fe6c4b369e93722242b29da | [
"MIT"
] | null | null | null | server/database_schemas/__init__.py | kaheicanaan/muffin | 38a635e861fb1e643fe6c4b369e93722242b29da | [
"MIT"
] | null | null | null | from . import base, messages, participants, rooms, users
| 28.5 | 56 | 0.77193 | from . import base, messages, participants, rooms, users
| 0 | 0 | 0 |
314e070709ba81f31502f4c772be9531b04818ba | 2,614 | py | Python | app.py | bestcondition/text-classification-annotation | 90845de8d4998bd3518621ffe154549c11ebabcf | [
"Apache-2.0"
] | null | null | null | app.py | bestcondition/text-classification-annotation | 90845de8d4998bd3518621ffe154549c11ebabcf | [
"Apache-2.0"
] | null | null | null | app.py | bestcondition/text-classification-annotation | 90845de8d4998bd3518621ffe154549c11ebabcf | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template, url_for, redirect
from pathlib import Path
import config
from controller import ProgressController
controller = ProgressController()
app = Flask(__name__)
@app.route('/')
@app.route('/tech/<stem>')
def tech(stem):
"""
显示技术要求
:param stem:
:return:
"... | 23.981651 | 74 | 0.647284 | from flask import Flask, render_template, url_for, redirect
from pathlib import Path
import config
from controller import ProgressController
controller = ProgressController()
app = Flask(__name__)
class ProcessView:
def __init__(self, process_controller: ProgressController):
self._controller = process_... | 1,452 | 554 | 138 |
4d253bfeb113617947832965829d6141f7a072db | 522 | py | Python | PolTools/utils/nested_multiprocessing_pool.py | GeoffSCollins/PolTools | 1ea9b166efc56610c385802f9491b4c8ec25a1d0 | [
"MIT"
] | null | null | null | PolTools/utils/nested_multiprocessing_pool.py | GeoffSCollins/PolTools | 1ea9b166efc56610c385802f9491b4c8ec25a1d0 | [
"MIT"
] | null | null | null | PolTools/utils/nested_multiprocessing_pool.py | GeoffSCollins/PolTools | 1ea9b166efc56610c385802f9491b4c8ec25a1d0 | [
"MIT"
] | null | null | null | import multiprocessing.pool | 29 | 71 | 0.584291 | import multiprocessing.pool
class NestedPool(multiprocessing.pool.Pool):
def Process(self, *args, **kwds):
proc = super(NestedPool, self).Process(*args, **kwds)
class NonDaemonProcess(proc.__class__):
"""Monkey-patch process to ensure it is never daemonized"""
@property
... | 423 | 23 | 49 |
fc351f58b3b3dad417d7efd5d253bcd77eaff9ec | 3,911 | py | Python | Components/mediawiki/wiki_data/extensions/CirrusSearch/scripts/compare-clusters.py | benkoo/XLP_ServiceMesh | 8c4c285f2e2c7b842064f94e40d4461677809046 | [
"MIT"
] | null | null | null | Components/mediawiki/wiki_data/extensions/CirrusSearch/scripts/compare-clusters.py | benkoo/XLP_ServiceMesh | 8c4c285f2e2c7b842064f94e40d4461677809046 | [
"MIT"
] | null | null | null | Components/mediawiki/wiki_data/extensions/CirrusSearch/scripts/compare-clusters.py | benkoo/XLP_ServiceMesh | 8c4c285f2e2c7b842064f94e40d4461677809046 | [
"MIT"
] | 1 | 2021-03-21T06:15:20.000Z | 2021-03-21T06:15:20.000Z | import json
import sys
batch_size = 2000
clusters = {
'eqiad': "search.svc.eqiad.wmnet",
'codfw': "search.svc.codfw.wmnet",
}
if __name__ == "__main__":
import math
import multiprocessing
if not len(sys.argv) == 2:
print("Usage: %s <wiki>\n" % (sys.argv[0]))
sys.exit(1)
... | 30.317829 | 79 | 0.56584 | import json
import sys
batch_size = 2000
clusters = {
'eqiad': "search.svc.eqiad.wmnet",
'codfw': "search.svc.codfw.wmnet",
}
def do_request(session, cluster, wiki, type, ids):
host = clusters[cluster]
path = "%(wiki)s_%(type)s/page/_mget" % locals()
url = 'http://%(host)s:9200/%(path)s?fields=_i... | 2,632 | 0 | 138 |
1bfae6aef617e36538ca5315fc1ec9902e20b581 | 213 | py | Python | app/demo/relations/apps.py | frankhood/django-material-admin | ea384bdf8ebcc59532fcb605519a8e9362e96414 | [
"MIT"
] | 270 | 2018-09-14T07:55:04.000Z | 2022-03-31T13:12:41.000Z | app/demo/relations/apps.py | frankhood/django-material-admin | ea384bdf8ebcc59532fcb605519a8e9362e96414 | [
"MIT"
] | 107 | 2019-03-26T20:35:23.000Z | 2022-03-15T15:34:38.000Z | app/demo/relations/apps.py | frankhood/django-material-admin | ea384bdf8ebcc59532fcb605519a8e9362e96414 | [
"MIT"
] | 66 | 2018-11-05T13:07:14.000Z | 2022-03-31T17:17:22.000Z | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
| 23.666667 | 55 | 0.751174 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class RelationsConfig(AppConfig):
name = 'demo.relations'
icon_name = 'layers'
verbose_name = _('Relations')
| 0 | 99 | 23 |
f67a142d23f284b3a2ae4c076b7c86d6d1e60ec8 | 3,460 | py | Python | Codes/PC-Interface/ctypes_opencv/src/setup.py | eyantra/Border_Surveillance_Robot_using_Firebird_ATmega2560 | 8e8b1b5a9dbeaec02c0ee20ae9046b2cf8f5b826 | [
"MIT"
] | 1 | 2017-08-28T16:04:20.000Z | 2017-08-28T16:04:20.000Z | Codes/PC-Interface/ctypes_opencv/src/setup.py | eyantra/Border_Surveillance_Robot_using_Firebird_ATmega2560 | 8e8b1b5a9dbeaec02c0ee20ae9046b2cf8f5b826 | [
"MIT"
] | null | null | null | Codes/PC-Interface/ctypes_opencv/src/setup.py | eyantra/Border_Surveillance_Robot_using_Firebird_ATmega2560 | 8e8b1b5a9dbeaec02c0ee20ae9046b2cf8f5b826 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# ctypes-opencv - A Python wrapper for OpenCV using ctypes
# Copyright (c) 2008, Minh-Tri Pham
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# * Redistributions of source... | 54.920635 | 755 | 0.75289 | #!/usr/bin/env python
# ctypes-opencv - A Python wrapper for OpenCV using ctypes
# Copyright (c) 2008, Minh-Tri Pham
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# * Redistributions of source... | 0 | 0 | 0 |
461953fc25bd98092632473b6cee30f1e1fdbac2 | 475 | py | Python | steamapi/gettoplivegame.py | NNTin/Dota-2-Meta-Analyzer | ce19ab414cbe0a8ff720539fd766db69604e3488 | [
"MIT"
] | 22 | 2016-03-27T21:28:18.000Z | 2021-09-13T14:48:43.000Z | steamapi/gettoplivegame.py | NNTin/Dota-2-Meta-Analyzer | ce19ab414cbe0a8ff720539fd766db69604e3488 | [
"MIT"
] | 24 | 2016-03-28T09:39:41.000Z | 2018-11-06T20:42:30.000Z | steamapi/gettoplivegame.py | NNTin/Reply-Dota-2-Reddit | e47d20f3d5bfacc9f39625324e57781e8d3f029a | [
"MIT"
] | null | null | null | import requests
from steamapi.steamapikey import SteamAPIKey
#message = True
| 29.6875 | 123 | 0.757895 | import requests
from steamapi.steamapikey import SteamAPIKey
#message = True
def requestGetTopLiveGame(partner):
#https://api.steampowered.com/IDOTA2Match_570/GetTopLiveGame/v1/?key=F79627788CAF92984B8B0E77FB29E9B8&partner=3
URL = "https://api.steampowered.com/IDOTA2Match_570/GetTopLiveGame/v1/?key=" + Stea... | 374 | 0 | 23 |
4909d4d7fb65c22e94a5109e9eb3377fd1387747 | 2,142 | py | Python | file_manager/migrations/0049_auto_20211110_1120.py | xiaofengxie128/Proteomic-Data-Manager | 79756c7021b1d5e4cc4cdb26d741f6ea18846a02 | [
"Apache-2.0"
] | null | null | null | file_manager/migrations/0049_auto_20211110_1120.py | xiaofengxie128/Proteomic-Data-Manager | 79756c7021b1d5e4cc4cdb26d741f6ea18846a02 | [
"Apache-2.0"
] | null | null | null | file_manager/migrations/0049_auto_20211110_1120.py | xiaofengxie128/Proteomic-Data-Manager | 79756c7021b1d5e4cc4cdb26d741f6ea18846a02 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.7 on 2021-11-10 18:20
from django.db import migrations, models
| 36.305085 | 104 | 0.596639 | # Generated by Django 3.2.7 on 2021-11-10 18:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('file_manager', '0048_auto_20211108_2000'),
]
operations = [
migrations.AddField(
model_name='rawfile',
name='file_si... | 0 | 2,028 | 23 |
b6495a631b9a8c7835628b702542182b2cc2efb9 | 3,880 | py | Python | qiskit/tools/visualization/interactive/_iplot_histogram.py | a-amaral/qiskit-terra | e73beba1e68de2617046a7e1e9eeac375b61de81 | [
"Apache-2.0"
] | 1 | 2020-07-14T19:40:01.000Z | 2020-07-14T19:40:01.000Z | qiskit/tools/visualization/interactive/_iplot_histogram.py | a-amaral/qiskit-terra | e73beba1e68de2617046a7e1e9eeac375b61de81 | [
"Apache-2.0"
] | null | null | null | qiskit/tools/visualization/interactive/_iplot_histogram.py | a-amaral/qiskit-terra | e73beba1e68de2617046a7e1e9eeac375b61de81 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
Histogram visualization
"""
from string import Template
from collections import Counter
import sys
import time
import re
... | 29.393939 | 87 | 0.586598 | # -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
Histogram visualization
"""
from string import Template
from collections import Counter
import sys
import time
import re
... | 0 | 0 | 0 |
ee5a628e9441f1ff1469e5840e03b1cccd2764ab | 3,936 | py | Python | varecof_io/writer/util.py | mobergd/interfaces | 82705d2173b9d213684da80913ec0593d30cdbe1 | [
"Apache-2.0"
] | null | null | null | varecof_io/writer/util.py | mobergd/interfaces | 82705d2173b9d213684da80913ec0593d30cdbe1 | [
"Apache-2.0"
] | null | null | null | varecof_io/writer/util.py | mobergd/interfaces | 82705d2173b9d213684da80913ec0593d30cdbe1 | [
"Apache-2.0"
] | null | null | null | """
Utility functions for formatting
"""
from qcelemental import constants as qcc
from qcelemental import periodictable as ptab
from automol import geom
# Conversion factors
BOHR2ANG = qcc.conversion_factor('bohr', 'angstrom')
def determine_struct_type(geo):
""" determines the linear string
"""
# Remo... | 31.741935 | 70 | 0.537348 | """
Utility functions for formatting
"""
from qcelemental import constants as qcc
from qcelemental import periodictable as ptab
from automol import geom
# Conversion factors
BOHR2ANG = qcc.conversion_factor('bohr', 'angstrom')
def determine_struct_type(geo):
""" determines the linear string
"""
# Remo... | 0 | 0 | 0 |
5d00cc9a5f08d4b0a03b0272cab82fb013f02787 | 5,209 | py | Python | datasets/Object-Detection/voc2coco.py | fuhao7i/Magic-box | 69cd3395b26b8fb9840dc6285d3d81fd56c236cd | [
"Apache-2.0"
] | null | null | null | datasets/Object-Detection/voc2coco.py | fuhao7i/Magic-box | 69cd3395b26b8fb9840dc6285d3d81fd56c236cd | [
"Apache-2.0"
] | null | null | null | datasets/Object-Detection/voc2coco.py | fuhao7i/Magic-box | 69cd3395b26b8fb9840dc6285d3d81fd56c236cd | [
"Apache-2.0"
] | null | null | null | import os
import os.path as osp
import random
import shutil
import sys
import json
import glob
import xml.etree.ElementTree as ET
import argparse
# voc_dir = '/data/xiaowenjie/nas/datasets/urpc2021/new_urpc/before/' #remember to modify the path
# voc_annotations = voc_dir + 'boxes/'
# txt_dir = voc_dir + 'txt/'
# coc... | 34.726667 | 99 | 0.563832 | import os
import os.path as osp
import random
import shutil
import sys
import json
import glob
import xml.etree.ElementTree as ET
import argparse
# voc_dir = '/data/xiaowenjie/nas/datasets/urpc2021/new_urpc/before/' #remember to modify the path
# voc_annotations = voc_dir + 'boxes/'
# txt_dir = voc_dir + 'txt/'
# coc... | 3,779 | 0 | 92 |
dc120abba621a32ef19a45fa96a310cebe889892 | 1,314 | py | Python | api/migrations/0002_auto_20210217_0327.py | felipebarraza6/emprende_escena | 6d42c9cc9973955d056697f556d3a872a533084c | [
"MIT"
] | null | null | null | api/migrations/0002_auto_20210217_0327.py | felipebarraza6/emprende_escena | 6d42c9cc9973955d056697f556d3a872a533084c | [
"MIT"
] | null | null | null | api/migrations/0002_auto_20210217_0327.py | felipebarraza6/emprende_escena | 6d42c9cc9973955d056697f556d3a872a533084c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-17 03:27
from django.db import migrations, models
| 30.55814 | 113 | 0.583714 | # Generated by Django 3.1.6 on 2021-02-17 03:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'verbose_name': 'Usuario... | 0 | 1,200 | 23 |
cc76bdd5e9514d9aebe3dd91ec66e3feb1cbbcd8 | 3,364 | py | Python | cpdb/social_graph/tests/serializers/test_social_graph_cr_detail_serializer.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 25 | 2018-07-20T22:31:40.000Z | 2021-07-15T16:58:41.000Z | cpdb/social_graph/tests/serializers/test_social_graph_cr_detail_serializer.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 13 | 2018-06-18T23:08:47.000Z | 2022-02-10T07:38:25.000Z | cpdb/social_graph/tests/serializers/test_social_graph_cr_detail_serializer.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 6 | 2018-05-17T21:59:43.000Z | 2020-11-17T00:30:26.000Z | import pytz
from datetime import datetime
from django.test import TestCase
from robber import expect
from data.constants import MEDIA_TYPE_DOCUMENT
from data.factories import (
AllegationFactory,
AllegationCategoryFactory,
AttachmentFileFactory,
OfficerFactory,
OfficerAllegationFactory,
Victi... | 32.346154 | 114 | 0.532105 | import pytz
from datetime import datetime
from django.test import TestCase
from robber import expect
from data.constants import MEDIA_TYPE_DOCUMENT
from data.factories import (
AllegationFactory,
AllegationCategoryFactory,
AttachmentFileFactory,
OfficerFactory,
OfficerAllegationFactory,
Victi... | 2,882 | 33 | 49 |
fe3a8929fa9d94102170986097f8195b05f7d50b | 3,218 | py | Python | rallyrolebot/constants.py | Ju99ernaut/RallyRoleBot | 068a66fce957c2d65fa8d121fa96abe8c7b00e2d | [
"MIT"
] | null | null | null | rallyrolebot/constants.py | Ju99ernaut/RallyRoleBot | 068a66fce957c2d65fa8d121fa96abe8c7b00e2d | [
"MIT"
] | null | null | null | rallyrolebot/constants.py | Ju99ernaut/RallyRoleBot | 068a66fce957c2d65fa8d121fa96abe8c7b00e2d | [
"MIT"
] | null | null | null | from discord import Color
# TODO: Place holder for now - can use __init__.py once dependencies such as
# data.ROLE_MAPPINGS_TABLE and rally_api.BASE_URL have been removed
"""
Constants useful for data module
"""
ROLE_MAPPINGS_TABLE = "mappings"
CHANNEL_MAPPINGS_TABLE = "channel_mappings"
RALLY_CONNECTIONS_TABLE = "r... | 31.54902 | 267 | 0.753574 | from discord import Color
# TODO: Place holder for now - can use __init__.py once dependencies such as
# data.ROLE_MAPPINGS_TABLE and rally_api.BASE_URL have been removed
"""
Constants useful for data module
"""
ROLE_MAPPINGS_TABLE = "mappings"
CHANNEL_MAPPINGS_TABLE = "channel_mappings"
RALLY_CONNECTIONS_TABLE = "r... | 0 | 0 | 0 |
910f4cbf2afcc54d1bf183779c52d25ab6d154e6 | 4,749 | py | Python | plugin/highlights.py | juliosueiras/LSP | e3090d1775587eedcf1ca65df62ba4bb67cc79c8 | [
"MIT"
] | null | null | null | plugin/highlights.py | juliosueiras/LSP | e3090d1775587eedcf1ca65df62ba4bb67cc79c8 | [
"MIT"
] | null | null | null | plugin/highlights.py | juliosueiras/LSP | e3090d1775587eedcf1ca65df62ba4bb67cc79c8 | [
"MIT"
] | null | null | null | import sublime
import sublime_plugin
from .core.configurations import is_supported_syntax
from .core.protocol import Request, Range, DocumentHighlightKind
from .core.registry import session_for_view, client_from_session
from .core.documents import get_document_position
from .core.settings import settings, client_confi... | 37.992 | 98 | 0.644978 | import sublime
import sublime_plugin
from .core.configurations import is_supported_syntax
from .core.protocol import Request, Range, DocumentHighlightKind
from .core.registry import session_for_view, client_from_session
from .core.documents import get_document_position
from .core.settings import settings, client_confi... | 3,667 | 305 | 46 |
8f5241da8a7ac8d05405007563d9e1dda6921114 | 743 | py | Python | Python/problem039.py | emergent/ProjectEuler | ec1c92cc47fde80efddeb0346d9b0fa511df1f00 | [
"Unlicense"
] | null | null | null | Python/problem039.py | emergent/ProjectEuler | ec1c92cc47fde80efddeb0346d9b0fa511df1f00 | [
"Unlicense"
] | null | null | null | Python/problem039.py | emergent/ProjectEuler | ec1c92cc47fde80efddeb0346d9b0fa511df1f00 | [
"Unlicense"
] | null | null | null | #! /usr/bin/env python3
'''
Problem 39 - Project Euler
http://projecteuler.net/index.php?section=problems&id=039
'''
import math
if __name__ == '__main__':
x = 5
pytha = []
while True:
a,b,c = getPythagoreanTriplet(x)
if a+b+c > 1000:
break
else:
if a != 0:
... | 20.638889 | 57 | 0.476447 | #! /usr/bin/env python3
'''
Problem 39 - Project Euler
http://projecteuler.net/index.php?section=problems&id=039
'''
import math
def getPythagoreanTriplet(a):
for b in reversed(range(1, a)):
c = math.sqrt(a**2 - b**2)
if c.is_integer():
return (a,b,int(c))
else:
return (0, 0... | 173 | 0 | 23 |
4ddc87be85bece32e7c114f821318661dca71079 | 1,035 | py | Python | python/main_add_soil_T_time_range.py | ywang37/GEOS-FP | 5301d78775325cc844791f4d81d564f274dc8109 | [
"NCSA",
"Apache-2.0",
"MIT"
] | null | null | null | python/main_add_soil_T_time_range.py | ywang37/GEOS-FP | 5301d78775325cc844791f4d81d564f274dc8109 | [
"NCSA",
"Apache-2.0",
"MIT"
] | null | null | null | python/main_add_soil_T_time_range.py | ywang37/GEOS-FP | 5301d78775325cc844791f4d81d564f274dc8109 | [
"NCSA",
"Apache-2.0",
"MIT"
] | null | null | null | """
Created on April 19, 2020
@author: Yi Wang
"""
import datetime
from mylib.geosfp.gc_process import geosfp_add_variables
#######################
# Start user parameters
#
gc_root_dir = '/Dedicated/jwang-data/GCDATA/GEOS_2x2.5/GEOS_FP/'
new_root_dir = '/Dedicated/jwang-data/GCDATA/GEOS_2x2.5/GEOS_FP_soil_T/'
s... | 21.5625 | 72 | 0.634783 | """
Created on April 19, 2020
@author: Yi Wang
"""
import datetime
from mylib.geosfp.gc_process import geosfp_add_variables
#######################
# Start user parameters
#
gc_root_dir = '/Dedicated/jwang-data/GCDATA/GEOS_2x2.5/GEOS_FP/'
new_root_dir = '/Dedicated/jwang-data/GCDATA/GEOS_2x2.5/GEOS_FP_soil_T/'
s... | 0 | 0 | 0 |
dbc22123321c216c41dd6456fdb0ccab77216d98 | 44,379 | py | Python | jira_agile_metrics/calculators/progressreport_test.py | simon2e/jira-agile-metrics | 86d52da50cd81c0cab681e2c487dfcc6dba9e376 | [
"MIT"
] | 1 | 2019-06-25T02:11:19.000Z | 2019-06-25T02:11:19.000Z | jira_agile_metrics/calculators/progressreport_test.py | simon2e/jira-agile-metrics | 86d52da50cd81c0cab681e2c487dfcc6dba9e376 | [
"MIT"
] | null | null | null | jira_agile_metrics/calculators/progressreport_test.py | simon2e/jira-agile-metrics | 86d52da50cd81c0cab681e2c487dfcc6dba9e376 | [
"MIT"
] | null | null | null | import random
import pytest
import pandas as pd
from datetime import datetime, date, timedelta
from ..conftest import (
FauxJIRA as JIRA,
FauxIssue as Issue,
FauxChange as Change,
FauxFieldValue as Value
)
from ..querymanager import QueryManager
from ..utils import extend_dict
from .progressreport imp... | 34.006897 | 152 | 0.554587 | import random
import pytest
import pandas as pd
from datetime import datetime, date, timedelta
from ..conftest import (
FauxJIRA as JIRA,
FauxIssue as Issue,
FauxChange as Change,
FauxFieldValue as Value
)
from ..querymanager import QueryManager
from ..utils import extend_dict
from .progressreport imp... | 43,309 | 0 | 432 |
3f7332b1b0a55125a5d849d37422e9a2d6cd70ac | 912 | py | Python | setup.py | myra-ink/model_fkeywords | 7f6166453ebf3250aad968fcadac0c403585c6d9 | [
"Apache-2.0"
] | null | null | null | setup.py | myra-ink/model_fkeywords | 7f6166453ebf3250aad968fcadac0c403585c6d9 | [
"Apache-2.0"
] | null | null | null | setup.py | myra-ink/model_fkeywords | 7f6166453ebf3250aad968fcadac0c403585c6d9 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
from setuptools.command.install import install
from setuptools import setup, find_packages
from distutils.command.install import install as _install
import os
PROJECT_DIR = os.path.dirname(__file__)
DEPENDENCIES = open(os.path.join(PROJECT_DIR, 'requirements.txt')).readline... | 35.076923 | 142 | 0.742325 | from setuptools import find_packages, setup
from setuptools.command.install import install
from setuptools import setup, find_packages
from distutils.command.install import install as _install
import os
PROJECT_DIR = os.path.dirname(__file__)
DEPENDENCIES = open(os.path.join(PROJECT_DIR, 'requirements.txt')).readline... | 0 | 0 | 0 |
9a0494cf74b3ef68079604981402c8cb5afa30da | 567 | py | Python | scripts/shared/cmdline.py | scala-native/benchmarks | 0de9421114f6fcdb339b968278b5372292acfa3b | [
"Apache-2.0"
] | 13 | 2018-09-13T05:07:53.000Z | 2022-02-13T11:40:34.000Z | scripts/shared/cmdline.py | scala-native/benchmarks | 0de9421114f6fcdb339b968278b5372292acfa3b | [
"Apache-2.0"
] | 4 | 2018-09-25T08:36:31.000Z | 2021-02-19T14:51:35.000Z | scripts/shared/cmdline.py | scala-native/scala-native-benchmarks | 0de9421114f6fcdb339b968278b5372292acfa3b | [
"Apache-2.0"
] | 8 | 2018-08-16T06:50:11.000Z | 2022-02-12T10:03:08.000Z | stable = 'scala-native-0.4.0-2.12'
latest = 'scala-native-0.4.1-SNAPSHOT-2.12' | 25.772727 | 44 | 0.583774 | stable = 'scala-native-0.4.0-2.12'
latest = 'scala-native-0.4.1-SNAPSHOT-2.12'
def expand_all(arg):
confs = []
for choice in arg:
expanded = expand_wild_cards(choice)
if expanded is None:
confs = [stable, latest]
else:
confs += [expanded]
return confs
def ex... | 443 | 0 | 46 |
5ac429e40ba7610ff323bf5568be7f303cb7a57d | 387 | py | Python | app/__init__.py | straterra/DreamerFlask | da8c16c105cb3008bcc2e9e995b518d892f21623 | [
"MIT"
] | null | null | null | app/__init__.py | straterra/DreamerFlask | da8c16c105cb3008bcc2e9e995b518d892f21623 | [
"MIT"
] | null | null | null | app/__init__.py | straterra/DreamerFlask | da8c16c105cb3008bcc2e9e995b518d892f21623 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Written by Thomas York
# Imports
from flask import Flask
from flask_hashing import Hashing
from config import Config
from flask_sqlalchemy import SQLAlchemy
# Flask Setup
app = Flask(__name__)
app.config.from_object(Config)
hashing = Hashing(app)
db = SQLAlchemy(app)
# Route setup
from app.route... | 16.826087 | 39 | 0.757106 | #!/usr/bin/python
# Written by Thomas York
# Imports
from flask import Flask
from flask_hashing import Hashing
from config import Config
from flask_sqlalchemy import SQLAlchemy
# Flask Setup
app = Flask(__name__)
app.config.from_object(Config)
hashing = Hashing(app)
db = SQLAlchemy(app)
# Route setup
from app.route... | 0 | 0 | 0 |
fbe11332bb561c96864971e5a879689742aca544 | 1,436 | py | Python | semester_1/lab_work_3/task_1/task_1.py | Alexandr-Mazanik/MIPT_lessons | 8eaba794c67136cd25688ef1d8bc22287747dd19 | [
"MIT"
] | null | null | null | semester_1/lab_work_3/task_1/task_1.py | Alexandr-Mazanik/MIPT_lessons | 8eaba794c67136cd25688ef1d8bc22287747dd19 | [
"MIT"
] | null | null | null | semester_1/lab_work_3/task_1/task_1.py | Alexandr-Mazanik/MIPT_lessons | 8eaba794c67136cd25688ef1d8bc22287747dd19 | [
"MIT"
] | 1 | 2020-11-14T06:48:39.000Z | 2020-11-14T06:48:39.000Z | """
Task 1
@author: Alexandr Mazanik
"""
import time
import turtle
main()
time.sleep(2)
| 19.146667 | 78 | 0.555014 | """
Task 1
@author: Alexandr Mazanik
"""
import time
import turtle
def main():
turtle.shape('turtle')
turtle.pensize(5)
turtle.speed(5)
preparation()
index = '141700' # индекс
delta_l = 30 # расстояние между цифрами
length = 100 # длина... | 1,282 | 0 | 138 |
90584b0a35800759a082a9d9359377d6cf1d28a4 | 5,360 | py | Python | server/problem_sets/gen/gens/testbed/old.py | iiridescent/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | null | null | null | server/problem_sets/gen/gens/testbed/old.py | iiridescent/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | 5 | 2021-03-09T10:36:59.000Z | 2022-02-26T14:36:08.000Z | server/problem_sets/gen/gens/testbed/old.py | vinhowe/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | null | null | null |
#%%
import IPython.display as ipyd
#%%
from IPython.display import Markdown
ideas = open('./design/ideas.md')
output = ideas.read()
Markdown(output)
#%% [markdown]
# ### Problem type description template
#%% [markdown]
# ### Problem type title
#
# Description
#
# #### Problem generation
#
# Outline of algorith... | 22.521008 | 185 | 0.659142 |
#%%
import IPython.display as ipyd
#%%
from IPython.display import Markdown
ideas = open('./design/ideas.md')
output = ideas.read()
Markdown(output)
#%% [markdown]
# ### Problem type description template
#%% [markdown]
# ### Problem type title
#
# Description
#
# #### Problem generation
#
# Outline of algorith... | 1,559 | 0 | 69 |
593b6ce9678df73c6f60b03f0ae38943e8b56040 | 2,418 | py | Python | tests/generators/ios/objc/test_parameters.py | brianleungwh/signals | d28d2722d681d390ebd21cd668d0b19f2f184451 | [
"MIT"
] | 3 | 2016-02-04T22:58:03.000Z | 2017-12-15T13:37:47.000Z | tests/generators/ios/objc/test_parameters.py | brianleungwh/signals | d28d2722d681d390ebd21cd668d0b19f2f184451 | [
"MIT"
] | 37 | 2015-08-28T20:17:23.000Z | 2021-12-13T19:48:49.000Z | tests/generators/ios/objc/test_parameters.py | brianleungwh/signals | d28d2722d681d390ebd21cd668d0b19f2f184451 | [
"MIT"
] | 6 | 2016-01-12T18:51:27.000Z | 2016-10-19T10:32:45.000Z | import unittest
from signals.generators.ios.objc.parameters import ObjCParameter
from signals.parser.fields import Field
from signals.parser.schema import DataObject
from tests.utils import create_dynamic_schema
| 42.421053 | 93 | 0.657568 | import unittest
from signals.generators.ios.objc.parameters import ObjCParameter
from signals.parser.fields import Field
from signals.parser.schema import DataObject
from tests.utils import create_dynamic_schema
class ParametersTestCase(unittest.TestCase):
def test_get_objc_data_type(self):
array_field = ... | 2,052 | 23 | 130 |
72020ef0ed4816d9a768e1ebd83f3779946b55c0 | 4,694 | py | Python | RSA_VS30_to_MMI.py | griffij/eq_hazmap_tests | db9d6202937b08b543758b8e190566116dbcf83b | [
"Apache-2.0"
] | 1 | 2021-12-03T16:55:03.000Z | 2021-12-03T16:55:03.000Z | RSA_VS30_to_MMI.py | griffij/eq_hazmap_tests | db9d6202937b08b543758b8e190566116dbcf83b | [
"Apache-2.0"
] | null | null | null | RSA_VS30_to_MMI.py | griffij/eq_hazmap_tests | db9d6202937b08b543758b8e190566116dbcf83b | [
"Apache-2.0"
] | 1 | 2019-10-12T09:55:31.000Z | 2019-10-12T09:55:31.000Z | """Converts 1 hz RSA from a bedrock hazard map to soil values
using the NEHRP amplifcation factors
Reference: Borchedt 1994
RSA is then converted to MMI using the formuala of Atkinson and Kaka (2006)
Jonathan Griffin, AIFDR January 2011
"""
import sys, os
import numpy as np
from scipy.interpolate import i... | 33.056338 | 84 | 0.534512 | """Converts 1 hz RSA from a bedrock hazard map to soil values
using the NEHRP amplifcation factors
Reference: Borchedt 1994
RSA is then converted to MMI using the formuala of Atkinson and Kaka (2006)
Jonathan Griffin, AIFDR January 2011
"""
import sys, os
import numpy as np
from scipy.interpolate import i... | 570 | 1,715 | 54 |
82dd64c27e97dca0af5f929db9726d4df2b1a744 | 1,324 | py | Python | kingfisher_scrapy/spiders/argentina_buenos_aires.py | sgaseretto/kingfisher-collect | 6ad6968e5f99f363ceee838277c27dacaf9cd969 | [
"BSD-3-Clause"
] | null | null | null | kingfisher_scrapy/spiders/argentina_buenos_aires.py | sgaseretto/kingfisher-collect | 6ad6968e5f99f363ceee838277c27dacaf9cd969 | [
"BSD-3-Clause"
] | null | null | null | kingfisher_scrapy/spiders/argentina_buenos_aires.py | sgaseretto/kingfisher-collect | 6ad6968e5f99f363ceee838277c27dacaf9cd969 | [
"BSD-3-Clause"
] | 1 | 2021-02-19T12:47:47.000Z | 2021-02-19T12:47:47.000Z | import json
import scrapy
from kingfisher_scrapy.base_spider import CompressedFileSpider
from kingfisher_scrapy.util import components, handle_http_error
class ArgentinaBuenosAires(CompressedFileSpider):
"""
Domain
Ciudad de Buenos Aires
API documentation
https://data.buenosaires.gob.ar/acer... | 34.842105 | 111 | 0.703927 | import json
import scrapy
from kingfisher_scrapy.base_spider import CompressedFileSpider
from kingfisher_scrapy.util import components, handle_http_error
class ArgentinaBuenosAires(CompressedFileSpider):
"""
Domain
Ciudad de Buenos Aires
API documentation
https://data.buenosaires.gob.ar/acer... | 523 | 0 | 53 |
0b12192fe22627e34f9bc6b2aec5e8e5ccf6e194 | 14,137 | py | Python | Lib/GCS/wrapper.py | jaescalo/Akamai-Account-Audit | 9a37b4d5afe1005c1dc6e2dd4f97eaf8e3d06030 | [
"MIT"
] | 3 | 2020-12-09T17:47:22.000Z | 2021-05-28T00:06:03.000Z | Lib/GCS/wrapper.py | jaescalo/Akamai-Account-Audit | 9a37b4d5afe1005c1dc6e2dd4f97eaf8e3d06030 | [
"MIT"
] | null | null | null | Lib/GCS/wrapper.py | jaescalo/Akamai-Account-Audit | 9a37b4d5afe1005c1dc6e2dd4f97eaf8e3d06030 | [
"MIT"
] | 1 | 2021-02-17T17:15:32.000Z | 2021-02-17T17:15:32.000Z | import requests, logging, json, sys
from Lib.GCS.http_calls import EdgeGridHttpCaller
from random import randint
from akamai.edgegrid import EdgeGridAuth
from Lib.GCS.config import EdgeGridConfig
import urllib
import socket
import subprocess
import os
import dns.resolver
import functools
class Wrapper:
"""
A simple ... | 30.078723 | 179 | 0.713942 | import requests, logging, json, sys
from Lib.GCS.http_calls import EdgeGridHttpCaller
from random import randint
from akamai.edgegrid import EdgeGridAuth
from Lib.GCS.config import EdgeGridConfig
import urllib
import socket
import subprocess
import os
import dns.resolver
import functools
class Wrapper:
"""
A simple ... | 3,849 | 0 | 238 |
ec3d24db25de219ea07ebab77b318f54fdbf14dc | 2,378 | py | Python | tests/test_crawler.py | dachenlian/weibospider | 4fe9e08efcca11573f485a2ddbad3b7bc422fa7c | [
"MIT"
] | 3,649 | 2017-10-22T12:08:22.000Z | 2022-03-27T06:29:28.000Z | tests/test_crawler.py | dachenlian/weibospider | 4fe9e08efcca11573f485a2ddbad3b7bc422fa7c | [
"MIT"
] | 146 | 2017-10-22T12:54:29.000Z | 2022-02-14T13:54:23.000Z | tests/test_crawler.py | dachenlian/weibospider | 4fe9e08efcca11573f485a2ddbad3b7bc422fa7c | [
"MIT"
] | 1,002 | 2017-10-25T03:44:17.000Z | 2022-03-24T08:49:59.000Z | import time
from urllib import parse as url_parse
import pytest
from page_get import (
get_cont_of_weibo, get_page, get_profile)
from tasks.comment import crawl_comment_by_page
from tasks.repost import crawl_repost_by_page
from tests import REQUEST_INTERNAL
HOME_AJAX_URL = 'http://weibo.com/p/aj/v6/mblog/mblogl... | 31.289474 | 114 | 0.708158 | import time
from urllib import parse as url_parse
import pytest
from page_get import (
get_cont_of_weibo, get_page, get_profile)
from tasks.comment import crawl_comment_by_page
from tasks.repost import crawl_repost_by_page
from tests import REQUEST_INTERNAL
HOME_AJAX_URL = 'http://weibo.com/p/aj/v6/mblog/mblogl... | 1,620 | 0 | 136 |
0fbca3e07c4a34929361cc25f6911fe78b4fe106 | 2,010 | py | Python | Python/examples/example2.py | RyanShahidi/easyml | fe0ecab6de02c0d91ef7de937cfb72ce7fcf3a51 | [
"MIT"
] | 37 | 2016-11-16T20:11:34.000Z | 2022-03-28T19:18:35.000Z | Python/examples/example2.py | RyanShahidi/easyml | fe0ecab6de02c0d91ef7de937cfb72ce7fcf3a51 | [
"MIT"
] | 76 | 2016-11-06T18:04:41.000Z | 2021-04-30T20:34:51.000Z | Python/examples/example2.py | CCS-Lab/easyML | 664076b4aba733751905ed351e5a320f20f1e520 | [
"MIT"
] | 18 | 2016-12-21T17:41:29.000Z | 2021-05-10T20:43:49.000Z | from glmnet import ElasticNet
import io
import numpy as np
import pandas as pd
import requests
from sklearn.preprocessing import StandardScaler
# Load data
url = 'https://raw.githubusercontent.com/CCS-Lab/easyml/master/Python/datasets/prostate.csv'
s = requests.get(url).content
prostate = pd.read_csv(io.StringIO(s.de... | 30.454545 | 106 | 0.738806 | from glmnet import ElasticNet
import io
import numpy as np
import pandas as pd
import requests
from sklearn.preprocessing import StandardScaler
# Load data
url = 'https://raw.githubusercontent.com/CCS-Lab/easyml/master/Python/datasets/prostate.csv'
s = requests.get(url).content
prostate = pd.read_csv(io.StringIO(s.de... | 0 | 0 | 0 |
9cc5d0cf3bc75d730a617fb4405aa3d01d0ee2a9 | 16,626 | py | Python | AppcestryCore/compare.py | jason-chao/appcestry | c3858e51ac27466cb008722453a3cc9882b2e6a1 | [
"MIT"
] | 3 | 2019-04-04T02:49:40.000Z | 2021-08-31T03:19:47.000Z | AppcestryCore/compare.py | jason-chao/appcestry | c3858e51ac27466cb008722453a3cc9882b2e6a1 | [
"MIT"
] | null | null | null | AppcestryCore/compare.py | jason-chao/appcestry | c3858e51ac27466cb008722453a3cc9882b2e6a1 | [
"MIT"
] | 2 | 2019-04-05T15:06:54.000Z | 2019-08-04T12:21:55.000Z | #!/usr/bin/env python3
# This script compares AppGene files for similiarty
# Run this script in terminal / command line to see the usage of arguments.
import os
import argparse
from sklearn.feature_extraction.text import HashingVectorizer
import json
import re
from sklearn.metrics.pairwise import cosine_similarity
im... | 41.669173 | 206 | 0.630218 | #!/usr/bin/env python3
# This script compares AppGene files for similiarty
# Run this script in terminal / command line to see the usage of arguments.
import os
import argparse
from sklearn.feature_extraction.text import HashingVectorizer
import json
import re
from sklearn.metrics.pairwise import cosine_similarity
im... | 0 | 0 | 0 |
96fb829ac6038a992c74970538966b4d981d57be | 546 | py | Python | corehq/apps/reports/v2/utils.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/reports/v2/utils.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/reports/v2/utils.py | omari-funzone/commcare-hq | 5edb462c891fc08e51c4babd7acdf12c0006a602 | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | from corehq.const import SERVER_DATETIME_FORMAT
from corehq.util.timezones.conversions import PhoneTime, ServerTime
from corehq.util.timezones.utils import get_timezone
| 34.125 | 69 | 0.727106 | from corehq.const import SERVER_DATETIME_FORMAT
from corehq.util.timezones.conversions import PhoneTime, ServerTime
from corehq.util.timezones.utils import get_timezone
def report_date_to_json(request, domain, date, is_phonetime=True):
timezone = get_timezone(request, domain)
if date:
if is_phonetime:... | 353 | 0 | 23 |
4b6a11e67196088c97e6abeb541ef85c169ff8c8 | 3,371 | py | Python | capiq_excel/downloader/tools.py | whoopnip/capiq-excel-downloader-py | 9500c4dad6157e1c7c6e59f159f8dcf5ab2ae287 | [
"MIT"
] | 10 | 2020-04-23T12:17:32.000Z | 2022-01-26T23:37:10.000Z | capiq_excel/downloader/tools.py | whoopnip/capiq-excel-downloader-py | 9500c4dad6157e1c7c6e59f159f8dcf5ab2ae287 | [
"MIT"
] | 7 | 2020-03-24T17:31:28.000Z | 2022-02-01T16:07:06.000Z | capiq_excel/downloader/tools.py | whoopnip/capiq-excel-downloader-py | 9500c4dad6157e1c7c6e59f159f8dcf5ab2ae287 | [
"MIT"
] | 6 | 2020-02-01T14:53:45.000Z | 2021-09-18T03:25:37.000Z | from typing import Dict
import pandas as pd
import warnings
from concurrent.futures import ThreadPoolExecutor, TimeoutError
from capiq_excel.downloader.timeout import TimeoutWrapper
from capiq_excel.fileops import get_path_of_failed_folder_add_if_necessary, move_file_to_failed_folder, get_path_of_additional_failed_fol... | 37.043956 | 159 | 0.732424 | from typing import Dict
import pandas as pd
import warnings
from concurrent.futures import ThreadPoolExecutor, TimeoutError
from capiq_excel.downloader.timeout import TimeoutWrapper
from capiq_excel.fileops import get_path_of_failed_folder_add_if_necessary, move_file_to_failed_folder, get_path_of_additional_failed_fol... | 1,262 | 0 | 115 |
d7794d2751d6e23b3cdaa72836458d23019b27c7 | 1,967 | py | Python | cidadaobr/endereco.py | yanorestes/cidadaobr | d91e94c58a23f6dafe4a1fc38c7738e241c87751 | [
"MIT"
] | 9 | 2018-02-06T02:34:38.000Z | 2019-06-12T02:01:09.000Z | cidadaobr/endereco.py | yyyyyyyan/cidadaobr | d91e94c58a23f6dafe4a1fc38c7738e241c87751 | [
"MIT"
] | 2 | 2019-08-20T01:27:04.000Z | 2019-08-22T16:45:23.000Z | cidadaobr/endereco.py | yyyyyyyan/cidadaobr | d91e94c58a23f6dafe4a1fc38c7738e241c87751 | [
"MIT"
] | 4 | 2021-02-26T02:00:23.000Z | 2022-02-26T22:35:48.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from requests import get, post
from bs4 import BeautifulSoup
from random import randint | 41.851064 | 176 | 0.577021 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from requests import get, post
from bs4 import BeautifulSoup
from random import randint
class Endereco():
estados = ('AC', 'AL', 'AM', 'AP', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MG', 'MS', 'MT', 'PA', 'PB', 'PE', 'PI', 'PR', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SE', 'S... | 1,533 | 281 | 23 |
787224de21edc0bd16e3016b55f59529e48b8898 | 315 | py | Python | src/chapter6/exercise3.py | group1BSE1/BSE-2021 | 43abaac6b6abd681e45ea56e3926eae211eef2b3 | [
"MIT"
] | null | null | null | src/chapter6/exercise3.py | group1BSE1/BSE-2021 | 43abaac6b6abd681e45ea56e3926eae211eef2b3 | [
"MIT"
] | null | null | null | src/chapter6/exercise3.py | group1BSE1/BSE-2021 | 43abaac6b6abd681e45ea56e3926eae211eef2b3 | [
"MIT"
] | null | null | null | print('This program finds the number of times a letter appears in a text')
word = input('Enter a text: ')
char = input('Enter letter to find its number of times: ')
count(word,char) | 31.5 | 74 | 0.64127 | print('This program finds the number of times a letter appears in a text')
word = input('Enter a text: ')
char = input('Enter letter to find its number of times: ')
def count(word,char):
count = 0
for letter in word:
if letter == char:
count = count + 1
print(count)
count(word,char) | 112 | 0 | 22 |
1d16c3b0bcd6642522d940e7e2ba225a2e80ae2f | 1,944 | py | Python | tests/test_tangles_prediction.py | Conzel/tangles | f5f1be754be9b53484f0ad5974232446934c5c74 | [
"MIT"
] | null | null | null | tests/test_tangles_prediction.py | Conzel/tangles | f5f1be754be9b53484f0ad5974232446934c5c74 | [
"MIT"
] | null | null | null | tests/test_tangles_prediction.py | Conzel/tangles | f5f1be754be9b53484f0ad5974232446934c5c74 | [
"MIT"
] | null | null | null | import numpy as np
from tangles.tree_tangles import get_hard_predictions
from tangles.loading import load_GMM
from sklearn.metrics import pairwise_distances
def test_simple_gaussians_ab():
"""
AB test to make sure the tangles algorithm still does the exact same thing.
"""
X, _ = load_GMM([20, 20], ... | 34.714286 | 90 | 0.562757 | import numpy as np
from tangles.tree_tangles import get_hard_predictions
from tangles.loading import load_GMM
from sklearn.metrics import pairwise_distances
def test_trivial():
np.random.seed(0)
X = np.block([
[np.ones((3, 3)), np.zeros((3, 3))],
[np.zeros((3, 3)), np.ones((3, 3))]
])
... | 482 | 0 | 46 |
3649c57b4c6bc5ea8cb8b2d39c0949cb288f0e3d | 6,243 | py | Python | homeassistant/components/vconnex/py_vconnex/api.py | hainguyen248/core | b783644ba7bec4ac215cb8bf0e8dc7169087aaad | [
"Apache-2.0"
] | null | null | null | homeassistant/components/vconnex/py_vconnex/api.py | hainguyen248/core | b783644ba7bec4ac215cb8bf0e8dc7169087aaad | [
"Apache-2.0"
] | null | null | null | homeassistant/components/vconnex/py_vconnex/api.py | hainguyen248/core | b783644ba7bec4ac215cb8bf0e8dc7169087aaad | [
"Apache-2.0"
] | null | null | null | """Vconnex integration"""
import hashlib
import hmac
import base64
import json
import time
from types import SimpleNamespace
from typing import Any
from enum import Enum
import requests
import logging
API__TOKEN = "/auth/project-token"
logger = logging.getLogger(__name__)
| 28.506849 | 86 | 0.509691 | """Vconnex integration"""
import hashlib
import hmac
import base64
import json
import time
from types import SimpleNamespace
from typing import Any
from enum import Enum
import requests
import logging
API__TOKEN = "/auth/project-token"
logger = logging.getLogger(__name__)
class TokenInfo:
... | 640 | 5,172 | 127 |
7012233ee96c832d97fd837d4721ac71d6d9cb06 | 159 | py | Python | images_storage/main/admin.py | py-course-if-2019/image_storage | c96576b9ec69123edc81eb43e3f23a3015d5d2d1 | [
"MIT"
] | null | null | null | images_storage/main/admin.py | py-course-if-2019/image_storage | c96576b9ec69123edc81eb43e3f23a3015d5d2d1 | [
"MIT"
] | 10 | 2020-02-12T00:55:59.000Z | 2022-02-10T11:32:56.000Z | images_storage/main/admin.py | py-course-if-2019-team/image_storage | 96ccc30f8b76efc703d9d021a9398516d1d60152 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Image
# Register your models here.
@admin.register(Image)
| 15.9 | 35 | 0.773585 | from django.contrib import admin
from .models import Image
# Register your models here.
@admin.register(Image)
class ImageAdmin(admin.ModelAdmin):
pass
| 0 | 23 | 22 |
ad4c18552209ff2a499cd90b6dbb6d73ef2e786b | 516 | py | Python | video_to_sound.py | chgiol/AnTel | a35f48463818797a1e3638654a997dcfb3bfbb9c | [
"MIT"
] | null | null | null | video_to_sound.py | chgiol/AnTel | a35f48463818797a1e3638654a997dcfb3bfbb9c | [
"MIT"
] | 2 | 2021-02-08T20:24:10.000Z | 2021-06-01T22:34:18.000Z | video_to_sound.py | chgiol/AnTel | a35f48463818797a1e3638654a997dcfb3bfbb9c | [
"MIT"
] | null | null | null | import os
import ntpath
#EL PROGRAMA PUEDE TENER INPUT DE UNA URL
#extraer_sonido(ruta)
| 24.571429 | 123 | 0.581395 | import os
import ntpath
#EL PROGRAMA PUEDE TENER INPUT DE UNA URL
def extraer_sonido(ruta):
try:
ruta = '"' + ruta + '"'
nombre_archivo = ntpath.basename(ruta)[:-4] + 'flac'
os.system(
"ffmpeg -y -i " + ruta + " -ar 16000 -ss 00:00:05 -t 01:00:00.0 -ac 1 -q:a 0 -map... | 389 | 0 | 25 |
eb58bca3f1a0ee6905d7f24d669c9815760cff24 | 459 | py | Python | python_brasilidades/doc_cpf.py | lariodiniz/Alura-Python-Brasil-validacao-de-dados | e8e2f551e69a996cf4d47c93cc60664670637289 | [
"MIT"
] | null | null | null | python_brasilidades/doc_cpf.py | lariodiniz/Alura-Python-Brasil-validacao-de-dados | e8e2f551e69a996cf4d47c93cc60664670637289 | [
"MIT"
] | null | null | null | python_brasilidades/doc_cpf.py | lariodiniz/Alura-Python-Brasil-validacao-de-dados | e8e2f551e69a996cf4d47c93cc60664670637289 | [
"MIT"
] | null | null | null | from validate_docbr import CPF
| 21.857143 | 45 | 0.59695 | from validate_docbr import CPF
class DocCpf:
def __init__(self, documento):
if self.valida(documento):
self.cpf = documento
else:
raise ValueError("CPF inválido!")
def formata(self):
mascara = CPF()
return mascara.mask(self.cpf)
def valida(self... | 306 | -8 | 131 |
d550811b9b958dfa8684e565f63f003fd94b1210 | 1,061 | py | Python | dstk.py | GriffinAustin/py-for-data-sci | 6caa5c2930990385f22ea61331e6d4340c85cdef | [
"MIT"
] | null | null | null | dstk.py | GriffinAustin/py-for-data-sci | 6caa5c2930990385f22ea61331e6d4340c85cdef | [
"MIT"
] | null | null | null | dstk.py | GriffinAustin/py-for-data-sci | 6caa5c2930990385f22ea61331e6d4340c85cdef | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
main() | 20.403846 | 51 | 0.542884 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
class GraphType():
HIST = 0
LINE = 1
class ManipData(object):
def __init__(self, df):
self.df = df
def clean(self):
self.df = self.df.dropna()
def graph(self, g, **kwargs):
if g ... | 699 | 26 | 201 |
c162a3744ae19c4b636b22d1317dc1d7c539c694 | 2,205 | py | Python | tests/test_linkedlist.py | yoshiohasegawa/python-data-structures | 22fdf2af19a5976d2a79fa944bcbd7337ec72549 | [
"MIT"
] | null | null | null | tests/test_linkedlist.py | yoshiohasegawa/python-data-structures | 22fdf2af19a5976d2a79fa944bcbd7337ec72549 | [
"MIT"
] | null | null | null | tests/test_linkedlist.py | yoshiohasegawa/python-data-structures | 22fdf2af19a5976d2a79fa944bcbd7337ec72549 | [
"MIT"
] | 1 | 2021-09-17T03:09:00.000Z | 2021-09-17T03:09:00.000Z | # Third party imports
import pytest
# pydatastructs imports
from pydatastructs.linkedlist import LinkedList
# Setup
# initialize _linkedlist in pytest fixture to be used in individual method tests
@pytest.fixture
# Executions
# append() adds a new instantiation of the Node class to the end of the linked list
# append... | 30.205479 | 84 | 0.687528 | # Third party imports
import pytest
# pydatastructs imports
from pydatastructs.linkedlist import LinkedList
# Setup
# initialize _linkedlist in pytest fixture to be used in individual method tests
@pytest.fixture
def linkedlist():
_linkedlist = LinkedList()
return _linkedlist
# Executions
# append() adds a ne... | 1,417 | 0 | 88 |
f7d4272cec3760a998d75de7e4cd1e7f7db5572b | 3,343 | py | Python | scripts/fig4/p1_prime_flexibility.py | choderalab/covid-moonshot-manuscript | 276d843bf9a30b4510cacb52045dc02c448fb964 | [
"MIT"
] | null | null | null | scripts/fig4/p1_prime_flexibility.py | choderalab/covid-moonshot-manuscript | 276d843bf9a30b4510cacb52045dc02c448fb964 | [
"MIT"
] | 1 | 2022-01-26T05:49:01.000Z | 2022-01-26T05:49:01.000Z | scripts/fig4/p1_prime_flexibility.py | choderalab/covid-moonshot-manuscript | 276d843bf9a30b4510cacb52045dc02c448fb964 | [
"MIT"
] | null | null | null | import pymol
from pymol import cmd, util
from sys import argv
# usage: pymol -cq script_name.py -- path/to/fragments/
path = argv[1:][0]
print(f"Using path: {path} for structures")
# Set some nice CB friendly colours
cmd.set_color("cb_orange", [0.96, 0.41, 0.23])
# Add filter (ambient) and other misc settings
cmd.s... | 29.324561 | 99 | 0.693987 | import pymol
from pymol import cmd, util
from sys import argv
# usage: pymol -cq script_name.py -- path/to/fragments/
path = argv[1:][0]
print(f"Using path: {path} for structures")
# Set some nice CB friendly colours
cmd.set_color("cb_orange", [0.96, 0.41, 0.23])
# Add filter (ambient) and other misc settings
cmd.s... | 0 | 0 | 0 |
b25bc60405417730817d378944cb7bade47478da | 2,550 | py | Python | mosaic/test/test_node.py | JohnKurian/mosaic | bc985640844e10b9aded478d6ef7a5f286ab2d82 | [
"BSD-3-Clause"
] | 6 | 2018-09-17T13:27:46.000Z | 2021-09-03T15:46:15.000Z | mosaic/test/test_node.py | JohnKurian/mosaic | bc985640844e10b9aded478d6ef7a5f286ab2d82 | [
"BSD-3-Clause"
] | null | null | null | mosaic/test/test_node.py | JohnKurian/mosaic | bc985640844e10b9aded478d6ef7a5f286ab2d82 | [
"BSD-3-Clause"
] | 2 | 2019-11-21T13:17:11.000Z | 2020-11-30T03:32:41.000Z | import unittest
from mosaic.node import Node
''' def test_fully_expanded(self):
def a_func(): return 0
def b_func(): return 0
def c_func(): return 0
x1 = ListTask(is_ordered=False, name = "x1", tasks = ["x1__p1", "x1__p2"])
x2 = ListTask(is_ordered=True, name = "x2", task... | 40.47619 | 92 | 0.586667 | import unittest
from mosaic.node import Node
class TestNode(unittest.TestCase):
def test_add_node(self):
node = Node()
assert(node.id_count == 0)
assert(node.get_attribute(0, "name") == "root")
node.add_node(name="v1", parent_node = 0)
assert(node.get_path_to_node(1, name... | 839 | 13 | 77 |
9b43b27a672db13a52d4be4fd0fcd42c9d26be3a | 2,164 | py | Python | Code/model_close.py | riemannruiz/analisis_datos | d7b8f140bd0f89a881aa30040966eacd5564fa3c | [
"MIT"
] | null | null | null | Code/model_close.py | riemannruiz/analisis_datos | d7b8f140bd0f89a881aa30040966eacd5564fa3c | [
"MIT"
] | 1 | 2019-03-21T21:16:00.000Z | 2019-03-21T21:16:00.000Z | Code/model_close.py | riemannruiz/analisis_datos | d7b8f140bd0f89a881aa30040966eacd5564fa3c | [
"MIT"
] | 3 | 2019-03-20T22:43:36.000Z | 2019-03-27T19:16:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 7 20:52:19 2019
@author: if715029
"""
### Crea los clusters de 5, 20, 40 y 125 días y los exporta a .sav
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from time import time
import pickle
t1 = time()
csv = ['... | 27.392405 | 94 | 0.656654 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 7 20:52:19 2019
@author: if715029
"""
### Crea los clusters de 5, 20, 40 y 125 días y los exporta a .sav
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from time import time
import pickle
t1 = time()
csv = ['... | 790 | 0 | 66 |
68bc65c7654afbeb74e4e391349581a05142cf1b | 461 | py | Python | gbe/models/evaluation_category.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 1 | 2021-03-14T11:56:47.000Z | 2021-03-14T11:56:47.000Z | gbe/models/evaluation_category.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 180 | 2019-09-15T19:52:46.000Z | 2021-11-06T23:48:01.000Z | gbe/models/evaluation_category.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | null | null | null | from django.db.models import (
BooleanField,
CharField,
Model,
TextField,
)
| 20.043478 | 53 | 0.633406 | from django.db.models import (
BooleanField,
CharField,
Model,
TextField,
)
class EvaluationCategory(Model):
category = CharField(
max_length=128,
unique=True)
visible = BooleanField(default=True)
help_text = TextField(blank=True)
def __str__(self):
return self... | 26 | 319 | 23 |
3ef58d260c258b183ae353dc7cbf6d9bfe45fe47 | 125 | py | Python | 214/countdown.py | xtakacsx/bitesofpy | 91487cbf58af5eb58a0343ff2231a90c1032acb0 | [
"MIT"
] | 1 | 2020-01-10T00:05:34.000Z | 2020-01-10T00:05:34.000Z | 214/countdown.py | xtakacsx/bitesofpy | 91487cbf58af5eb58a0343ff2231a90c1032acb0 | [
"MIT"
] | null | null | null | 214/countdown.py | xtakacsx/bitesofpy | 91487cbf58af5eb58a0343ff2231a90c1032acb0 | [
"MIT"
] | null | null | null | def countdown():
"""Write a generator that counts from 100 to 1"""
for i in reversed(range(1, 101)):
yield i
| 25 | 53 | 0.608 | def countdown():
"""Write a generator that counts from 100 to 1"""
for i in reversed(range(1, 101)):
yield i
| 0 | 0 | 0 |
f6d44e6f3bf3b79805140e147d5bb167424d8141 | 702 | py | Python | tf2recommender/applications/neural_cf/ncf_config.py | dvarelas/tensorflow2-recommender | 7798d40c8c06cc2ea786237c9e58d2bb9fcd7462 | [
"MIT"
] | 9 | 2019-10-28T16:34:37.000Z | 2021-07-30T13:56:19.000Z | tf2recommender/applications/neural_cf/ncf_config.py | dvarelas/tensorflow2-recommender | 7798d40c8c06cc2ea786237c9e58d2bb9fcd7462 | [
"MIT"
] | 3 | 2020-11-13T18:28:49.000Z | 2022-02-10T00:35:14.000Z | tf2recommender/applications/neural_cf/ncf_config.py | dvarelas/tensorflow2-recommender | 7798d40c8c06cc2ea786237c9e58d2bb9fcd7462 | [
"MIT"
] | 2 | 2020-05-06T10:05:54.000Z | 2020-10-28T15:44:04.000Z | from tf2recommender.config.local import ColumnNames
config = {
'training_args':
NcfTrainingArguments(
user_dim=10,
item_dim=6,
batch_size=16,
num_epochs=5,
hidden1_dim=8,
hidden2_dim=2),
'col_names':
ColumnNames(user_col='user', item_col='item', rating_... | 26 | 79 | 0.648148 | from tf2recommender.config.local import ColumnNames
class NcfTrainingArguments(object):
def __init__(self, user_dim, item_dim, batch_size, num_epochs, hidden1_dim,
hidden2_dim):
self.user_dim = user_dim
self.item_dim = item_dim
self.batch_size = batch_size
self.num... | 303 | 14 | 49 |
170f040109970ea281f30e9adb297272472bff9e | 1,080 | py | Python | OS/processScheduling/PCB.py | cheniison/Experiment | acc0308e0a4a1e4ef297ecf92231af3aae3aaa74 | [
"MIT"
] | null | null | null | OS/processScheduling/PCB.py | cheniison/Experiment | acc0308e0a4a1e4ef297ecf92231af3aae3aaa74 | [
"MIT"
] | null | null | null | OS/processScheduling/PCB.py | cheniison/Experiment | acc0308e0a4a1e4ef297ecf92231af3aae3aaa74 | [
"MIT"
] | null | null | null | """
进程控制类
"""
"""
PCB
进程控制块
"""
"""
进程控制块队列
"""
| 22.5 | 73 | 0.552778 | """
进程控制类
"""
"""
PCB
进程控制块
"""
class PCB(object):
def __init__(self, name, a_time, e_time, priority):
self.name = name # 进程名
self.u_time = 0 # 已经被调度的时间
self.a_time = a_time # 进程到来的时间
self.e_time = e_time # 预计需要被调度的时间
self.priority = pri... | 861 | -2 | 231 |
342864ac298e6ca2939aa4bf5515c1cd981ffc49 | 2,856 | py | Python | christinaqqbot/plugins/Rss/__init__.py | Whitesad/ChristinaQQbot | a00aba6bd4cd38dab581c0513d544479bebd934b | [
"MIT"
] | 13 | 2020-12-16T02:43:59.000Z | 2021-05-20T01:30:26.000Z | christinaqqbot/plugins/Rss/__init__.py | Whitesad/ChristinaQQbot | a00aba6bd4cd38dab581c0513d544479bebd934b | [
"MIT"
] | 1 | 2021-03-13T10:26:43.000Z | 2021-03-13T10:26:43.000Z | christinaqqbot/plugins/Rss/__init__.py | Whitesad/ChristinaQQbot | a00aba6bd4cd38dab581c0513d544479bebd934b | [
"MIT"
] | 1 | 2021-08-02T07:20:42.000Z | 2021-08-02T07:20:42.000Z | from nonebot import on_command
from nonebot.rule import to_me
from nonebot.adapters.cqhttp import Bot,Event
from nonebot.adapters.cqhttp import MessageSegment as msg
from nonebot.log import logger
from .util import check_rss,update_rss,rss_db_init,rss_server,add_rss,query_user_rss,remove_rss
from .model import Rss
fr... | 43.938462 | 146 | 0.639706 | from nonebot import on_command
from nonebot.rule import to_me
from nonebot.adapters.cqhttp import Bot,Event
from nonebot.adapters.cqhttp import MessageSegment as msg
from nonebot.log import logger
from .util import check_rss,update_rss,rss_db_init,rss_server,add_rss,query_user_rss,remove_rss
from .model import Rss
fr... | 2,564 | 0 | 22 |
7ea025cef28abd2aed87e246542bc60614f1532a | 3,975 | py | Python | src/ml_dev_utils/Timer.py | maryamltu/ML-Dev-Utils | db349db00e086c661cdea46b9cbdecf666bb4634 | [
"MIT"
] | 1 | 2021-11-24T13:14:44.000Z | 2021-11-24T13:14:44.000Z | src/ml_dev_utils/Timer.py | maryamltu/ML-Dev-Utils | db349db00e086c661cdea46b9cbdecf666bb4634 | [
"MIT"
] | 3 | 2021-11-12T10:24:14.000Z | 2021-11-12T13:40:24.000Z | src/ml_dev_utils/Timer.py | LTU-Machine-Learning/ML-Dev-Utils | db349db00e086c661cdea46b9cbdecf666bb4634 | [
"MIT"
] | 1 | 2021-11-23T07:31:22.000Z | 2021-11-23T07:31:22.000Z | """
Timer
======
This module measures the execution time and provides three ways to do this:
* **MeasureTime**: Measure time as decorator ``@MeasureTime``.
* **MeasureBlockTime**: Measure as ``with MeasureBlockTime("my_block") as my_block:``.
* **Timer**: Measure as instance ``timer = Timer()``
"""
from __future__ im... | 24.090909 | 95 | 0.626415 | """
Timer
======
This module measures the execution time and provides three ways to do this:
* **MeasureTime**: Measure time as decorator ``@MeasureTime``.
* **MeasureBlockTime**: Measure as ``with MeasureBlockTime("my_block") as my_block:``.
* **Timer**: Measure as instance ``timer = Timer()``
"""
from __future__ im... | 807 | 0 | 180 |
02376be51f4e3f7cd6fe04774db932cba7875e89 | 61,826 | py | Python | integration/ack/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | integration/ack/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | integration/ack/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | from regression_tests import *
| 69.234043 | 116 | 0.748617 | from regression_tests import *
class TestBase(Test):
def test_produce_expected_output(self):
self.assert_c_produces_output_when_run(
input='1 1',
expected_output='ackerman( 1 , 1 ) = 3\n',
expected_return_code=3
)
self.assert_c_produces_output_when_run(
... | 59,093 | 2,285 | 417 |
ce580b94316d6e7918c749aaea2c9902077dc9ba | 1,046 | py | Python | bad_code.py | the-code-critics/001-datastructures | 2e73cd3c4e7d167829109dd146e6f14bcbdd68ea | [
"Apache-2.0"
] | null | null | null | bad_code.py | the-code-critics/001-datastructures | 2e73cd3c4e7d167829109dd146e6f14bcbdd68ea | [
"Apache-2.0"
] | null | null | null | bad_code.py | the-code-critics/001-datastructures | 2e73cd3c4e7d167829109dd146e6f14bcbdd68ea | [
"Apache-2.0"
] | null | null | null | """
BAD CODE
The problem is in the data structure. Loading the movie database as a list
of lists causes the function movies() to find the movies of a user to be
of linear complexity O(1) and the function shared() to find shared movies to be
of quadratic complexity O(m*m).
The good code has constant complexity O(1) fo... | 24.904762 | 79 | 0.669216 | """
BAD CODE
The problem is in the data structure. Loading the movie database as a list
of lists causes the function movies() to find the movies of a user to be
of linear complexity O(1) and the function shared() to find shared movies to be
of quadratic complexity O(m*m).
The good code has constant complexity O(1) fo... | 384 | 0 | 69 |
b4dde29e1247a2f3b9c1513710eaecd4f03c9bf7 | 3,390 | py | Python | gimmemotifs/tools/gadem.py | simonvh/gimmemotifs | e40ab914a93210864c358b39ae677ac0792a80f2 | [
"MIT"
] | 20 | 2015-08-22T23:14:12.000Z | 2018-07-24T15:41:58.000Z | gimmemotifs/tools/gadem.py | simonvh/gimmemotifs | e40ab914a93210864c358b39ae677ac0792a80f2 | [
"MIT"
] | 62 | 2015-05-01T10:02:47.000Z | 2018-11-05T15:39:44.000Z | gimmemotifs/tools/gadem.py | simonvh/gimmemotifs | e40ab914a93210864c358b39ae677ac0792a80f2 | [
"MIT"
] | 8 | 2016-01-06T15:54:41.000Z | 2018-08-24T15:26:12.000Z | from .motifprogram import MotifProgram
import os
import shutil
from subprocess import Popen, PIPE
from gimmemotifs.motif import Motif
class Gadem(MotifProgram):
"""
Predict motifs using GADEM.
Reference:
"""
def _run_program(self, bin, fastafile, params=None):
"""
Run GADEM and... | 26.904762 | 87 | 0.476991 | from .motifprogram import MotifProgram
import os
import shutil
from subprocess import Popen, PIPE
from gimmemotifs.motif import Motif
class Gadem(MotifProgram):
"""
Predict motifs using GADEM.
Reference:
"""
def __init__(self):
self.name = "GADEM"
self.cmd = "gadem"
sel... | 84 | 0 | 27 |
db5be8b86783d564dc2306694291dd2112048f72 | 976 | py | Python | python/snail-clock-wise.py | love-adela/snippets | d803938f927e7c2b5c82607052ccf4470fb56204 | [
"MIT"
] | null | null | null | python/snail-clock-wise.py | love-adela/snippets | d803938f927e7c2b5c82607052ccf4470fb56204 | [
"MIT"
] | 5 | 2021-03-19T08:51:02.000Z | 2022-03-12T00:06:30.000Z | python/snail-clock-wise.py | love-adela/snippets | d803938f927e7c2b5c82607052ccf4470fb56204 | [
"MIT"
] | null | null | null | """
C, R (= 열, 행) = 7, 6일 때
[6, 7, 8, 9, 10, 11, 12]
[5, 26, 27, 28, 29, 30, 13]
[4, 25, 38, 39, 40, 31, 14]
[3, 24, 37, 42, 41, 32, 15]
[2, 23, 36, 35, 34, 33, 16]
[1, 22, 21, 20, 19, 18, 17]
"""
C, R = map(int, input().split())
grid = [[0]* C for _ in range(R)]
count, offset = 0, 0
max_size = C*R
while R > 0 and ... | 19.918367 | 45 | 0.471311 | """
C, R (= 열, 행) = 7, 6일 때
[6, 7, 8, 9, 10, 11, 12]
[5, 26, 27, 28, 29, 30, 13]
[4, 25, 38, 39, 40, 31, 14]
[3, 24, 37, 42, 41, 32, 15]
[2, 23, 36, 35, 34, 33, 16]
[1, 22, 21, 20, 19, 18, 17]
"""
C, R = map(int, input().split())
grid = [[0]* C for _ in range(R)]
count, offset = 0, 0
max_size = C*R
while R > 0 and ... | 0 | 0 | 0 |
f02bee0fd775a36e0a452bef32ef724859158e86 | 1,041 | py | Python | pythontabcmd2/parsers/create_site_users_parser.py | playkazoomedia/tabcmd2 | a89db9be6047d95379a7c88264236e9cb3e78189 | [
"MIT"
] | 11 | 2020-09-02T03:41:01.000Z | 2022-01-20T12:38:20.000Z | pythontabcmd2/parsers/create_site_users_parser.py | playkazoomedia/tabcmd2 | a89db9be6047d95379a7c88264236e9cb3e78189 | [
"MIT"
] | 19 | 2020-09-03T04:54:47.000Z | 2022-01-31T17:41:19.000Z | pythontabcmd2/parsers/create_site_users_parser.py | playkazoomedia/tabcmd2 | a89db9be6047d95379a7c88264236e9cb3e78189 | [
"MIT"
] | 6 | 2020-11-21T15:45:51.000Z | 2022-01-24T12:26:20.000Z | import sys
from .parent_parser import ParentParser
from .common_parser import CommonParser
class CreateSiteUsersParser:
"""
Parser for createsiteusers command
"""
@staticmethod
def create_site_user_parser():
"""Method to parse create site users arguments passed by the user"""
paren... | 40.038462 | 76 | 0.596542 | import sys
from .parent_parser import ParentParser
from .common_parser import CommonParser
class CreateSiteUsersParser:
"""
Parser for createsiteusers command
"""
@staticmethod
def create_site_user_parser():
"""Method to parse create site users arguments passed by the user"""
paren... | 0 | 0 | 0 |
07c3b621994e21409177b65e1e4572be62531131 | 1,788 | py | Python | bot/utils/errors.py | r8vnhill/stickfix | 9d9b7cafc8e48bbae3e68d3801fac68e7bc78675 | [
"CC-BY-4.0"
] | null | null | null | bot/utils/errors.py | r8vnhill/stickfix | 9d9b7cafc8e48bbae3e68d3801fac68e7bc78675 | [
"CC-BY-4.0"
] | 7 | 2020-03-02T00:41:40.000Z | 2020-04-26T00:35:30.000Z | bot/utils/errors.py | r8vnhill/stickfix | 9d9b7cafc8e48bbae3e68d3801fac68e7bc78675 | [
"CC-BY-4.0"
] | null | null | null | """ "Stickfix" (c) by Ignacio Slater M.
"Stickfix" is licensed under a
Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <http://creativecommons.org/licenses/by/4.0/>.
"""
from bot.utils.logger import StickfixLogger
... | 28.380952 | 95 | 0.70302 | """ "Stickfix" (c) by Ignacio Slater M.
"Stickfix" is licensed under a
Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <http://creativecommons.org/licenses/by/4.0/>.
"""
from bot.utils.logger import StickfixLogger
... | 137 | 0 | 27 |
9752f7a1a4652a91731a653df38a04021a276350 | 363 | py | Python | engr1330jb/_build/jupyter_execute/lessons/lesson34/lesson34.py | dustykat/engr-1330-psuedo-course | 3e7e31a32a1896fcb1fd82b573daa5248e465a36 | [
"CC0-1.0"
] | null | null | null | engr1330jb/_build/jupyter_execute/lessons/lesson34/lesson34.py | dustykat/engr-1330-psuedo-course | 3e7e31a32a1896fcb1fd82b573daa5248e465a36 | [
"CC0-1.0"
] | null | null | null | engr1330jb/_build/jupyter_execute/lessons/lesson34/lesson34.py | dustykat/engr-1330-psuedo-course | 3e7e31a32a1896fcb1fd82b573daa5248e465a36 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# <div class="alert alert-block alert-info">
# <b><h1>ENGR 1330 Computational Thinking with Data Science </h1></b>
# </div>
#
# Copyright © 2021 Theodore G. Cleveland and Farhang Forghanparast
#
# Last GitHub Commit Date:
#
# # 34: KNN Applications
# - application
#
#... | 12.517241 | 74 | 0.62259 | #!/usr/bin/env python
# coding: utf-8
# <div class="alert alert-block alert-info">
# <b><h1>ENGR 1330 Computational Thinking with Data Science </h1></b>
# </div>
#
# Copyright © 2021 Theodore G. Cleveland and Farhang Forghanparast
#
# Last GitHub Commit Date:
#
# # 34: KNN Applications
# - application
#
#... | 0 | 0 | 0 |
4aefb55f09f838a7c64f0169f098363e5e985123 | 1,124 | py | Python | proteus/tests/levelset/vortex/redist_vortex_3d_p.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | null | null | null | proteus/tests/levelset/vortex/redist_vortex_3d_p.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 13 | 2018-02-08T23:22:59.000Z | 2020-12-06T19:40:32.000Z | proteus/tests/levelset/vortex/redist_vortex_3d_p.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 1 | 2020-02-17T03:25:34.000Z | 2020-02-17T03:25:34.000Z | from __future__ import absolute_import
from proteus import *
from proteus.default_p import *
from math import *
from .vortex import *
from proteus.mprans import RDLS
from . import ls_vortex_3d_p
name=soname+"_rdls"
LevelModelType = RDLS.LevelModel
coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
... | 27.414634 | 72 | 0.734875 | from __future__ import absolute_import
from proteus import *
from proteus.default_p import *
from math import *
from .vortex import *
from proteus.mprans import RDLS
from . import ls_vortex_3d_p
name=soname+"_rdls"
LevelModelType = RDLS.LevelModel
coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
... | 7 | 0 | 23 |
43546e07569555e58edec00accc2ba0e0c159064 | 3,594 | py | Python | src/xapitrader/core/data/stream/commands.py | SarithT/xapitrader | 0018bc37d9756a10c328def90d042ef39857cfb5 | [
"MIT"
] | null | null | null | src/xapitrader/core/data/stream/commands.py | SarithT/xapitrader | 0018bc37d9756a10c328def90d042ef39857cfb5 | [
"MIT"
] | null | null | null | src/xapitrader/core/data/stream/commands.py | SarithT/xapitrader | 0018bc37d9756a10c328def90d042ef39857cfb5 | [
"MIT"
] | null | null | null | from xapitrader.core.data.stream.base import StreamDataInterface
from xapitrader.types import types
from xapitrader.types import utils
| 33.90566 | 127 | 0.714524 | from xapitrader.core.data.stream.base import StreamDataInterface
from xapitrader.types import types
from xapitrader.types import utils
class getBalance(StreamDataInterface):
def __init__(self, client, streamSessionId: str):
super().__init__(client, streamSessionId)
def _set_func(self, callback):
... | 2,349 | 152 | 958 |
685f9ac89ba1e48b392a518fb71baa1ecc465d7a | 9,059 | py | Python | text/tests/unittests/text_prediction/mx/test_preprocessing.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 4,462 | 2019-12-09T17:41:07.000Z | 2022-03-31T22:00:41.000Z | text/tests/unittests/text_prediction/mx/test_preprocessing.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 1,408 | 2019-12-09T17:48:59.000Z | 2022-03-31T20:24:12.000Z | text/tests/unittests/text_prediction/mx/test_preprocessing.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 623 | 2019-12-10T02:04:18.000Z | 2022-03-20T17:11:01.000Z | import pytest
from mxnet.util import use_np
from mxnet.gluon.data import DataLoader
import numpy as np
import numpy.testing as npt
import tempfile
import pickle
import os
from sklearn.model_selection import train_test_split
from autogluon.core.utils.loaders import load_pd
from autogluon.text.text_prediction.mx.preproce... | 56.61875 | 114 | 0.611215 | import pytest
from mxnet.util import use_np
from mxnet.gluon.data import DataLoader
import numpy as np
import numpy.testing as npt
import tempfile
import pickle
import os
from sklearn.model_selection import train_test_split
from autogluon.core.utils.loaders import load_pd
from autogluon.text.text_prediction.mx.preproce... | 7,429 | 0 | 67 |
447f47fb083328074990f66f88cd6f77a299e43c | 239 | py | Python | koabot/__init__.py | luni3359/koa-bot | 3faf4af89f2a414313e651088f6fd16d12e298ec | [
"MIT"
] | 2 | 2020-05-05T03:02:39.000Z | 2021-07-05T13:38:21.000Z | koabot/__init__.py | luni3359/koa-bot | 3faf4af89f2a414313e651088f6fd16d12e298ec | [
"MIT"
] | 65 | 2019-01-05T05:51:47.000Z | 2022-03-26T17:39:20.000Z | koabot/__init__.py | luni3359/koa-bot | 3faf4af89f2a414313e651088f6fd16d12e298ec | [
"MIT"
] | 1 | 2021-01-06T03:39:00.000Z | 2021-01-06T03:39:00.000Z | """__init.py__"""
import sys
MIN_PYTHON_VERSION = (3, 8)
if sys.version_info < MIN_PYTHON_VERSION:
version_str = '.'.join(map(str, MIN_PYTHON_VERSION))
raise EnvironmentError("Python version needs to be at least " + version_str)
| 26.555556 | 80 | 0.728033 | """__init.py__"""
import sys
MIN_PYTHON_VERSION = (3, 8)
if sys.version_info < MIN_PYTHON_VERSION:
version_str = '.'.join(map(str, MIN_PYTHON_VERSION))
raise EnvironmentError("Python version needs to be at least " + version_str)
| 0 | 0 | 0 |
43cfe2101cf60101d3e5bb80cfacd472bc8b619b | 1,666 | py | Python | examples/models/file/panels.py | afonit/bokeh | 37a9d6c81ed592d07effd0d3584befd0fc95b53c | [
"BSD-3-Clause"
] | 1 | 2018-12-19T06:52:07.000Z | 2018-12-19T06:52:07.000Z | examples/models/file/panels.py | afonit/bokeh | 37a9d6c81ed592d07effd0d3584befd0fc95b53c | [
"BSD-3-Clause"
] | 1 | 2017-01-12T00:37:38.000Z | 2017-01-12T00:37:38.000Z | examples/models/file/panels.py | afonit/bokeh | 37a9d6c81ed592d07effd0d3584befd0fc95b53c | [
"BSD-3-Clause"
] | 1 | 2018-03-02T09:57:56.000Z | 2018-03-02T09:57:56.000Z | from bokeh.plotting import show, output_file
from bokeh.models import Plot, Title, Circle, ColumnDataSource, DataRange1d, LinearAxis, Range1d
xdr = DataRange1d()
ydr = DataRange1d()
p = Plot(
title=None, toolbar_location=None,
x_range=xdr, y_range=ydr,
plot_width=800, plot_height=800,
min_border=30,
... | 29.22807 | 96 | 0.696879 | from bokeh.plotting import show, output_file
from bokeh.models import Plot, Title, Circle, ColumnDataSource, DataRange1d, LinearAxis, Range1d
xdr = DataRange1d()
ydr = DataRange1d()
p = Plot(
title=None, toolbar_location=None,
x_range=xdr, y_range=ydr,
plot_width=800, plot_height=800,
min_border=30,
... | 88 | 0 | 23 |
53450aa8be6bf9cdf3995ef618c370fd0916a588 | 83,569 | py | Python | tensorflow_estimator/python/estimator/canned/v1/dnn_testing_utils_v1.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | 2 | 2019-05-13T16:37:32.000Z | 2019-09-17T22:01:38.000Z | tensorflow_estimator/python/estimator/canned/v1/dnn_testing_utils_v1.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | null | null | null | tensorflow_estimator/python/estimator/canned/v1/dnn_testing_utils_v1.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | 2 | 2019-09-17T22:02:05.000Z | 2020-10-22T03:56:07.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.081055 | 145 | 0.626895 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 15,409 | 31,635 | 734 |
58b6517a8bf3c3c557d60bc3419a37e754a31431 | 19,945 | py | Python | ietf/settings.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2015-09-02T19:53:12.000Z | 2015-09-02T19:53:12.000Z | ietf/settings.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/settings.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright The IETF Trust 2007, All Rights Reserved
# Django settings for ietf project.
# BASE_DIR and "settings_local" are from
# http://code.djangoproject.com/wiki/SplitSettings
import os
try:
import syslog
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
except ImportError:
pass
BASE_DI... | 32.85832 | 148 | 0.727501 | # Copyright The IETF Trust 2007, All Rights Reserved
# Django settings for ietf project.
# BASE_DIR and "settings_local" are from
# http://code.djangoproject.com/wiki/SplitSettings
import os
try:
import syslog
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
except ImportError:
pass
BASE_DI... | 359 | 0 | 44 |
dc9f87a5c8585617df4b878962093d6f8cf38ccc | 2,519 | py | Python | logistic_regression.py | osamadel/neural_nets | 9e91e814c1ef16231c89d40ee0eb766e667cfa11 | [
"MIT"
] | null | null | null | logistic_regression.py | osamadel/neural_nets | 9e91e814c1ef16231c89d40ee0eb766e667cfa11 | [
"MIT"
] | null | null | null | logistic_regression.py | osamadel/neural_nets | 9e91e814c1ef16231c89d40ee0eb766e667cfa11 | [
"MIT"
] | null | null | null | # Logistic regression
#%%
# Importing libraries
import numpy as np
import random
from matplotlib import pyplot as plt
#%%
#%%
# Generating training data
x = np.linspace(1, 10, 1000)[:, np.newaxis].T
y = np.hstack((np.zeros((1,500)), np.ones((1,500))))
# Adding some randomness
y[0,random.randint(0,500)] = 1
y[0,rando... | 27.988889 | 90 | 0.555776 | # Logistic regression
#%%
# Importing libraries
import numpy as np
import random
from matplotlib import pyplot as plt
#%%
class LogisticRegression():
def __init__(self):
self.w = np.random.rand(1,1)
self.b = np.random.rand(1,1)
self.J = 0
def __sigmoid(self, z):
return 1 / ... | 135 | 1,390 | 22 |
7d64b0862ce3706026875f6f82930750688dcd22 | 1,832 | py | Python | recipe_scrapers/tests/test_whatsgabycooking.py | IsaiahData/recipe-scrapers | d9ffc2e066af1d82f244806cff6f7bdd1a5a38d0 | [
"MIT"
] | 1 | 2021-01-18T01:43:36.000Z | 2021-01-18T01:43:36.000Z | recipe_scrapers/tests/test_whatsgabycooking.py | IsaiahData/recipe-scrapers | d9ffc2e066af1d82f244806cff6f7bdd1a5a38d0 | [
"MIT"
] | null | null | null | recipe_scrapers/tests/test_whatsgabycooking.py | IsaiahData/recipe-scrapers | d9ffc2e066af1d82f244806cff6f7bdd1a5a38d0 | [
"MIT"
] | null | null | null | import os
import unittest
from recipe_scrapers.whatsgabycooking import WhatsGabyCooking
| 33.309091 | 376 | 0.600437 | import os
import unittest
from recipe_scrapers.whatsgabycooking import WhatsGabyCooking
class TestWhatsGabyCookingScraper(unittest.TestCase):
def setUp(self):
# tests are run from tests.py
with open(os.path.join(
os.getcwd(),
'recipe_scrapers',
'tests',
... | 1,526 | 32 | 184 |
e0f9a9874ec2cf91f5ec738ecb05c48483d46fc3 | 956 | py | Python | packages/mpi/Cartesian.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | packages/mpi/Cartesian.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | packages/mpi/Cartesian.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# superclasses
from .Communicator import Communicator
# declaration
class Cartesian(Communicator):
"""
An encapsulation of Cartesian communicators
"""
# per-instance public data
axes = None
... | 20.782609 | 89 | 0.641213 | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# superclasses
from .Communicator import Communicator
# declaration
class Cartesian(Communicator):
"""
An encapsulation of Cartesian communicators
"""
# per-instance public data
axes = None
... | 536 | 0 | 26 |
bc39cc65a64bcc442bf1cdd6f2240c85e9ed3c9c | 4,196 | py | Python | extras/utils.py | narutonz/analyser | 63b62338b54e218412c53bfc3f6731d07f5bf3ee | [
"MIT"
] | null | null | null | extras/utils.py | narutonz/analyser | 63b62338b54e218412c53bfc3f6731d07f5bf3ee | [
"MIT"
] | null | null | null | extras/utils.py | narutonz/analyser | 63b62338b54e218412c53bfc3f6731d07f5bf3ee | [
"MIT"
] | null | null | null | from configparser import ConfigParser
from pymongo import MongoClient
from math import pow, sqrt
__author__ = 'MuhamadNoorZainal MuhamadZabidi'
__version__ = '1.5'
| 32.78125 | 113 | 0.539323 | from configparser import ConfigParser
from pymongo import MongoClient
from math import pow, sqrt
__author__ = 'MuhamadNoorZainal MuhamadZabidi'
__version__ = '1.5'
class Database(object):
def __init__(self, col_name):
self.client = MongoClient()
self.db = self.client['Tweets']
... | 3,780 | 2 | 227 |
f58557ac6ec2c79c4276a2580581ed867b280531 | 6,629 | py | Python | utils/enhanced_universal_dependencies_reader.py | coastalcph/HIT-SCIR-CoNLL2019 | 60258a81a2db91ca012be4486ea8475376756374 | [
"Apache-2.0"
] | 5 | 2020-05-27T14:18:50.000Z | 2021-05-28T05:07:19.000Z | utils/enhanced_universal_dependencies_reader.py | coastalcph/HIT-SCIR-CoNLL2019 | 60258a81a2db91ca012be4486ea8475376756374 | [
"Apache-2.0"
] | 1 | 2020-05-25T13:56:00.000Z | 2020-05-25T13:56:00.000Z | utils/enhanced_universal_dependencies_reader.py | coastalcph/HIT-SCIR-CoNLL2019 | 60258a81a2db91ca012be4486ea8475376756374 | [
"Apache-2.0"
] | 1 | 2020-06-02T16:50:04.000Z | 2020-06-02T16:50:04.000Z | from typing import Dict, Tuple, List, Any
import logging
from overrides import overrides
from conllu import parse_incr, string_to_file
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import Field, TextField, SequenceLa... | 42.767742 | 119 | 0.596168 | from typing import Dict, Tuple, List, Any
import logging
from overrides import overrides
from conllu import parse_incr, string_to_file
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import Field, TextField, SequenceLa... | 3,681 | 0 | 53 |
83741f809120fb22061ef5cfb9868a00a9efb7dd | 4,891 | py | Python | osr2mp4/VideoProcess/FrameWriter.py | FireRedz/osr2mp4-core | a75c4200efcb6ab5401423ca5883388675f8858c | [
"MIT"
] | 1 | 2021-04-30T10:54:51.000Z | 2021-04-30T10:54:51.000Z | osr2mp4/VideoProcess/FrameWriter.py | FireRedz/osr2mp4-core | a75c4200efcb6ab5401423ca5883388675f8858c | [
"MIT"
] | 4 | 2020-12-16T11:14:08.000Z | 2021-09-09T06:13:43.000Z | osr2mp4/VideoProcess/FrameWriter.py | FireRedz/osr2mp4-core | a75c4200efcb6ab5401423ca5883388675f8858c | [
"MIT"
] | null | null | null | import os
import time
import traceback
import numpy as np
import math
import cv2
from pathlib import Path
from osr2mp4 import logger
from osr2mp4.global_var import videoextensions
from osr2mp4.Exceptions import CannotCreateVideo, FourccIsNotExtension, WrongFourcc, LibAvNotFound
### TODO: MOVE THIS TO ITS OWN FILE
###... | 27.632768 | 137 | 0.681456 | import os
import time
import traceback
import numpy as np
import math
import cv2
from pathlib import Path
from osr2mp4 import logger
from osr2mp4.global_var import videoextensions
from osr2mp4.Exceptions import CannotCreateVideo, FourccIsNotExtension, WrongFourcc, LibAvNotFound
### TODO: MOVE THIS TO ITS OWN FILE
def ... | 4,408 | 0 | 160 |
5a6f10c0e0590c6201285848780e3ec1595360e5 | 2,092 | py | Python | pytorch_widedeep/preprocessing/base_preprocessor.py | rajshah4/pytorch-widedeep | 6540cd3cb33b2d7f0ad55e73371094e0d4f9907b | [
"MIT"
] | 692 | 2019-10-08T11:14:06.000Z | 2022-03-31T04:06:42.000Z | pytorch_widedeep/preprocessing/base_preprocessor.py | rajshah4/pytorch-widedeep | 6540cd3cb33b2d7f0ad55e73371094e0d4f9907b | [
"MIT"
] | 69 | 2019-12-18T10:53:47.000Z | 2022-03-29T22:45:51.000Z | pytorch_widedeep/preprocessing/base_preprocessor.py | rajshah4/pytorch-widedeep | 6540cd3cb33b2d7f0ad55e73371094e0d4f9907b | [
"MIT"
] | 85 | 2019-11-17T04:54:03.000Z | 2022-02-21T15:43:43.000Z | import pandas as pd
from sklearn.exceptions import NotFittedError
from pytorch_widedeep.wdtypes import * # noqa: F403
# This class does not represent any sctructural advantage, but I keep it to
# keep things tidy, as guidance for contribution and because is useful for the
# check_is_fitted function
class BasePrepro... | 34.866667 | 78 | 0.690249 | import pandas as pd
from sklearn.exceptions import NotFittedError
from pytorch_widedeep.wdtypes import * # noqa: F403
# This class does not represent any sctructural advantage, but I keep it to
# keep things tidy, as guidance for contribution and because is useful for the
# check_is_fitted function
class BasePrepro... | 298 | 0 | 108 |
897ecfd8db8b8cf97144ce29f763759ba4992a46 | 191 | py | Python | test_resources/postponed_tuple.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | test_resources/postponed_tuple.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | test_resources/postponed_tuple.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import NamedTuple
| 12.733333 | 34 | 0.696335 | from __future__ import annotations
from typing import NamedTuple
class Tuplicity(NamedTuple):
a: int
b: int
class Tuplicitous(NamedTuple):
a: int
b: int
c: Tuplicity
| 0 | 77 | 46 |
dccbac16ee9c8dc57d08c256701d9bb9192d37e8 | 2,059 | py | Python | roles/certs/files/leforward.py | mattsta/mailweb | de5f691e8ddf4dc3534f90c3e5ab4cd6bfd2c100 | [
"Apache-2.0"
] | 9 | 2018-10-22T19:52:02.000Z | 2020-08-07T21:26:33.000Z | roles/certs/files/leforward.py | mattsta/mailweb | de5f691e8ddf4dc3534f90c3e5ab4cd6bfd2c100 | [
"Apache-2.0"
] | 5 | 2019-04-08T22:10:15.000Z | 2019-04-14T09:05:32.000Z | roles/certs/files/leforward.py | mattsta/mailweb | de5f691e8ddf4dc3534f90c3e5ab4cd6bfd2c100 | [
"Apache-2.0"
] | 9 | 2018-10-29T08:44:58.000Z | 2020-09-15T01:18:55.000Z | #!/usr/bin/env python3
""" Run a single-purpose HTTP server.
Server takes all GET requests and redirects them to a new host
if the request URI starts with SUBPATH, otherwise returns 404.
Requests are redirected to the URL provided by --baseurl. """
import socketserver
import http.server
import argparse
import sys
... | 29.84058 | 77 | 0.689169 | #!/usr/bin/env python3
""" Run a single-purpose HTTP server.
Server takes all GET requests and redirects them to a new host
if the request URI starts with SUBPATH, otherwise returns 404.
Requests are redirected to the URL provided by --baseurl. """
import socketserver
import http.server
import argparse
import sys
... | 225 | 40 | 49 |
8c11d25bb80a4f6a5f2bd4df18ed10b74a8fb8ef | 1,009 | py | Python | tomes_darcmail/lib/eaxs/ParameterType.py | StateArchivesOfNorthCarolina/docker_dmc | c387a4bcd91346bedf3a4c4f242fb7f35d5a81c1 | [
"MIT"
] | null | null | null | tomes_darcmail/lib/eaxs/ParameterType.py | StateArchivesOfNorthCarolina/docker_dmc | c387a4bcd91346bedf3a4c4f242fb7f35d5a81c1 | [
"MIT"
] | 1 | 2018-11-23T17:04:52.000Z | 2018-11-23T17:04:52.000Z | tomes_darcmail/lib/eaxs/ParameterType.py | StateArchivesOfNorthCarolina/docker_dmc | c387a4bcd91346bedf3a4c4f242fb7f35d5a81c1 | [
"MIT"
] | null | null | null | #############################################################
# 2016-09-26: ParameterType.py
# Author: Jeremy M. Gibson (State Archives of North Carolina)
#
# Description: Implementation of the parameter-type
##############################################################
from lxml.ElementInclude import etree
class Pa... | 29.676471 | 62 | 0.526264 | #############################################################
# 2016-09-26: ParameterType.py
# Author: Jeremy M. Gibson (State Archives of North Carolina)
#
# Description: Implementation of the parameter-type
##############################################################
from lxml.ElementInclude import etree
class Pa... | 111 | 0 | 27 |
b494a8c94ded6c88c28d5c79277bc50ba9d3062e | 78 | py | Python | models.py | KG5321/aiir_server | 5152d9fc43165f96ec7a4ef11c58f98af938314e | [
"MIT"
] | null | null | null | models.py | KG5321/aiir_server | 5152d9fc43165f96ec7a4ef11c58f98af938314e | [
"MIT"
] | null | null | null | models.py | KG5321/aiir_server | 5152d9fc43165f96ec7a4ef11c58f98af938314e | [
"MIT"
] | null | null | null | #from server import db
#class User(db.Model):
# __tablename__ = 'users'
| 11.142857 | 28 | 0.666667 | #from server import db
#class User(db.Model):
# __tablename__ = 'users'
| 0 | 0 | 0 |
9c35e63ff891e357bd4cd4a4f47d0ba51fccc3ad | 1,240 | py | Python | dataset.py | sankalpg10/GAN_Even_Num_Generator | 48afb5b663f0cb1109ff0b494f11857cb8ec9c6f | [
"MIT"
] | null | null | null | dataset.py | sankalpg10/GAN_Even_Num_Generator | 48afb5b663f0cb1109ff0b494f11857cb8ec9c6f | [
"MIT"
] | null | null | null | dataset.py | sankalpg10/GAN_Even_Num_Generator | 48afb5b663f0cb1109ff0b494f11857cb8ec9c6f | [
"MIT"
] | null | null | null | import math
import numpy as np
from typing import Tuple, List | 36.470588 | 96 | 0.675 | import math
import numpy as np
def int_to_bin(number: int) -> int:
# if number is negative or not an integer raise an error
if number < 0 or type(number) is not int:
raise ValueError("only positive integers are allowed")
# converts binary number into a list and returns it
return [... | 1,132 | 0 | 46 |
e41edbe5b90d5662dc48f9ed41b52221ac69c240 | 18,379 | py | Python | thyme/trajectory.py | nw13slx/thyme | b2a16aa1e6b0701adcfd2bd146f85b5c46b35254 | [
"MIT"
] | null | null | null | thyme/trajectory.py | nw13slx/thyme | b2a16aa1e6b0701adcfd2bd146f85b5c46b35254 | [
"MIT"
] | null | null | null | thyme/trajectory.py | nw13slx/thyme | b2a16aa1e6b0701adcfd2bd146f85b5c46b35254 | [
"MIT"
] | null | null | null | import logging
import numpy as np
import pickle
from copy import deepcopy
from ase.atoms import Atoms
from thyme.utils.cell import convert_cell_format
from thyme.utils.savenload import save_file, load_file
from thyme.utils.atomic_symbols import species_to_order_label
from ._key import *
| 31.633391 | 102 | 0.534088 | import logging
import numpy as np
import pickle
from copy import deepcopy
from ase.atoms import Atoms
from thyme.utils.cell import convert_cell_format
from thyme.utils.savenload import save_file, load_file
from thyme.utils.atomic_symbols import species_to_order_label
from ._key import *
class Trajectory(object):
... | 10,385 | 7,679 | 23 |
e30ecab5bdfb66af55e6a96d71eae30038b881d6 | 2,633 | py | Python | main.py | Rishav-12/PyPaint | f089b076ebb0fec25940fadbf7f0ec04ffc08c8a | [
"MIT"
] | null | null | null | main.py | Rishav-12/PyPaint | f089b076ebb0fec25940fadbf7f0ec04ffc08c8a | [
"MIT"
] | null | null | null | main.py | Rishav-12/PyPaint | f089b076ebb0fec25940fadbf7f0ec04ffc08c8a | [
"MIT"
] | null | null | null | import pygame
pygame.init()
ROWS = 45
COLS = 50
SQUARE_SIZE = 8
WIDTH, HEIGHT = 400, 400
win = pygame.display.set_mode((WIDTH, HEIGHT))
win.fill("white")
pygame.display.set_caption("PyPaint")
COLORS = ["red", "green", "blue", "yellow", "purple", "black"]
drawing_color = COLORS[5]
grid_squares = []
buttons = []
c... | 27.14433 | 101 | 0.659704 | import pygame
pygame.init()
class GridSquare:
def __init__(self, left, top, width, height):
self.rect = pygame.Rect(left, top, width, height)
self.color = "white"
def draw(self, window):
pygame.draw.rect(window, self.color, self.rect)
class ColorButton:
def __init__(self, left, to... | 727 | -7 | 242 |
a059f0453b19080525868db8bb2d3803e22fa1c6 | 1,913 | py | Python | tests/test_s3.py | unj-inovacao/tucuxi | 104b1f178b38dcc625bd64643c0986a1cfee8f53 | [
"MIT"
] | null | null | null | tests/test_s3.py | unj-inovacao/tucuxi | 104b1f178b38dcc625bd64643c0986a1cfee8f53 | [
"MIT"
] | 7 | 2020-05-28T19:10:01.000Z | 2020-08-14T17:34:13.000Z | tests/test_s3.py | unj-inovacao/tucuxi | 104b1f178b38dcc625bd64643c0986a1cfee8f53 | [
"MIT"
] | null | null | null | """Tests for the tucuxi.s3 Module using some fixtures from conftest.py"""
import logging
from typing import Dict
from typing import List
from tucuxi import S3
logger = logging.getLogger(__name__)
def test_set_get_object(s3_name: str, objs: List[Dict[str, str]]) -> None:
"""[summary]
Args:
s3_name (... | 26.569444 | 79 | 0.606377 | """Tests for the tucuxi.s3 Module using some fixtures from conftest.py"""
import logging
from typing import Dict
from typing import List
from tucuxi import S3
logger = logging.getLogger(__name__)
def test_set_get_object(s3_name: str, objs: List[Dict[str, str]]) -> None:
"""[summary]
Args:
s3_name (... | 0 | 0 | 0 |
a0b100048d88ef4f6ebe6954f2ce7217f8c1436a | 150 | py | Python | create_db.py | forestmonster/flaskr-tdd | 1891fb165602c135e1332200d75a6008c2d4e543 | [
"MIT"
] | null | null | null | create_db.py | forestmonster/flaskr-tdd | 1891fb165602c135e1332200d75a6008c2d4e543 | [
"MIT"
] | null | null | null | create_db.py | forestmonster/flaskr-tdd | 1891fb165602c135e1332200d75a6008c2d4e543 | [
"MIT"
] | null | null | null | from app import db
from models import Flaskr
# Create the database, and the table within.
db.create_all()
# Commit the changes.
db.session.commit()
| 16.666667 | 44 | 0.76 | from app import db
from models import Flaskr
# Create the database, and the table within.
db.create_all()
# Commit the changes.
db.session.commit()
| 0 | 0 | 0 |
81f40ab41f543f19fa7eaf47b7696d80cc6e647c | 1,277 | py | Python | src/encoded/tests/test_reports_decorators.py | procha2/encoded | e9f122362b71f3b8641023b8d2d5ad531d3484b7 | [
"MIT"
] | 102 | 2015-05-20T01:17:43.000Z | 2022-03-07T06:03:55.000Z | src/encoded/tests/test_reports_decorators.py | procha2/encoded | e9f122362b71f3b8641023b8d2d5ad531d3484b7 | [
"MIT"
] | 901 | 2015-01-07T23:11:57.000Z | 2022-03-18T13:56:12.000Z | src/encoded/tests/test_reports_decorators.py | procha2/encoded | e9f122362b71f3b8641023b8d2d5ad531d3484b7 | [
"MIT"
] | 65 | 2015-02-06T23:00:26.000Z | 2022-01-22T07:58:44.000Z | import pytest
from encoded.tests.features.conftest import app, app_settings, index_workbook
from pyramid.exceptions import HTTPBadRequest
pytestmark = [
pytest.mark.indexing,
pytest.mark.usefixtures('index_workbook'),
]
| 29.022727 | 77 | 0.723571 | import pytest
from encoded.tests.features.conftest import app, app_settings, index_workbook
from pyramid.exceptions import HTTPBadRequest
pytestmark = [
pytest.mark.indexing,
pytest.mark.usefixtures('index_workbook'),
]
def test_reports_decorators_allowed_types_decorator_raises_error():
from encoded.r... | 973 | 0 | 69 |
b5d5243a4213906b3a0fc69cf15b23bfb0ebf84e | 2,713 | py | Python | dataset.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | 1 | 2021-09-22T01:30:05.000Z | 2021-09-22T01:30:05.000Z | dataset.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | null | null | null | dataset.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | 1 | 2021-09-22T01:32:06.000Z | 2021-09-22T01:32:06.000Z | import torch
from torch.nn import functional as F
from torch.utils.data import Dataset, DataLoader
import numpy as np
import math
import os
import Audio
from text import text_to_sequence
from utils import process_text, pad_1D, pad_2D
import hparams
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu'... | 28.861702 | 74 | 0.63509 | import torch
from torch.nn import functional as F
from torch.utils.data import Dataset, DataLoader
import numpy as np
import math
import os
import Audio
from text import text_to_sequence
from utils import process_text, pad_1D, pad_2D
import hparams
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu'... | 2,204 | 0 | 127 |
d2d095c48a428f426d6c686a462eac3b84968dc2 | 4,170 | py | Python | aspc/sagelist/models.py | aspc/mainsite | a6ccee0bb921147b7f630d65e01371e451aa3c54 | [
"MIT"
] | 8 | 2015-09-27T07:57:32.000Z | 2018-10-28T06:08:40.000Z | aspc/sagelist/models.py | aspc/mainsite | a6ccee0bb921147b7f630d65e01371e451aa3c54 | [
"MIT"
] | 132 | 2015-01-17T01:22:09.000Z | 2018-11-13T22:05:32.000Z | aspc/sagelist/models.py | aspc/mainsite | a6ccee0bb921147b7f630d65e01371e451aa3c54 | [
"MIT"
] | 20 | 2015-01-16T04:32:30.000Z | 2018-09-03T22:55:05.000Z | from django.db import models
from django.contrib.auth.models import User
from aspc.activityfeed.signals import new_activity, delete_activity
from aspc.courses.models import Course
from amazon.api import AmazonAPI
import datetime
from aspc.settings import AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG
import jso... | 35.948276 | 99 | 0.671223 | from django.db import models
from django.contrib.auth.models import User
from aspc.activityfeed.signals import new_activity, delete_activity
from aspc.courses.models import Course
from amazon.api import AmazonAPI
import datetime
from aspc.settings import AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG
import jso... | 1,866 | 1,832 | 23 |
f71aeff53f61023328ab2b142760b44cd1843c8c | 6,750 | py | Python | tests/test_etdrk4fxcy.py | liuyxpp/chebpy | 05a9492d0d78591a39923e4a85a0f24bcc79ae4f | [
"BSD-3-Clause"
] | null | null | null | tests/test_etdrk4fxcy.py | liuyxpp/chebpy | 05a9492d0d78591a39923e4a85a0f24bcc79ae4f | [
"BSD-3-Clause"
] | null | null | null | tests/test_etdrk4fxcy.py | liuyxpp/chebpy | 05a9492d0d78591a39923e4a85a0f24bcc79ae4f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#/usr/bin/env python
import numpy as np
import matplotlib.pylab as plt
from timer import Timer
from chebpy import ETDRK4FxCy, ETDRK4FxCy2, BC, ETDRK4
from chebpy import ROBIN, DIRICHLET
def test_etdrk4fxcy():
'''
The test function is
u = e^[f(x,y) - t]
where
... | 30.681818 | 79 | 0.493333 | # -*- coding: utf-8 -*-
#/usr/bin/env python
import numpy as np
import matplotlib.pylab as plt
from timer import Timer
from chebpy import ETDRK4FxCy, ETDRK4FxCy2, BC, ETDRK4
from chebpy import ROBIN, DIRICHLET
def test_etdrk4fxcy():
'''
The test function is
u = e^[f(x,y) - t]
where
... | 0 | 0 | 0 |
442b315bc6544dd388dc33f7f4ea1f98ba501c4d | 262 | py | Python | cracking_the_coding_interview_qs/1.3/urlify.py | angelusualle/algorithms | 86286a49db2a755bc57330cb455bcbd8241ea6be | [
"Apache-2.0"
] | null | null | null | cracking_the_coding_interview_qs/1.3/urlify.py | angelusualle/algorithms | 86286a49db2a755bc57330cb455bcbd8241ea6be | [
"Apache-2.0"
] | null | null | null | cracking_the_coding_interview_qs/1.3/urlify.py | angelusualle/algorithms | 86286a49db2a755bc57330cb455bcbd8241ea6be | [
"Apache-2.0"
] | null | null | null | # O(n) time, O(n) space | 23.818182 | 37 | 0.492366 | # O(n) time, O(n) space
def urlify(url, length):
urlified_string = ""
i = 0
while i < length:
if url[i] == " ":
urlified_string += "%20"
else:
urlified_string += url[i]
i += 1
return urlified_string | 217 | 0 | 22 |
3144e0f1f0ae2498211769135d5bf19b7308b07b | 304 | py | Python | Extension Attributes/ActiveDirectoryComputerPasswordChangeInterval.py | hhorn76/JAMF | 35b81f305ba58f07c133693deb7d3a25fc82ed4f | [
"MIT"
] | 33 | 2018-11-16T09:20:22.000Z | 2022-03-15T04:16:03.000Z | Extension Attributes/ActiveDirectoryComputerPasswordChangeInterval.py | hhorn76/JAMF | 35b81f305ba58f07c133693deb7d3a25fc82ed4f | [
"MIT"
] | 1 | 2019-07-28T13:50:29.000Z | 2019-11-11T10:47:20.000Z | Extension Attributes/ActiveDirectoryComputerPasswordChangeInterval.py | hhorn76/JAMF | 35b81f305ba58f07c133693deb7d3a25fc82ed4f | [
"MIT"
] | 6 | 2019-05-07T05:28:45.000Z | 2021-12-09T18:01:28.000Z | #!/usr/bin/python
# Written by Heiko 2019.02.07
# Will return the password change interval from Active Directory
import subprocess
result = subprocess.check_output( 'dsconfigad -show | grep \'Password change interval\' | awk \'{print $5}\' ', shell=True).strip()
print '<result>' + result + '</result>' | 38 | 131 | 0.717105 | #!/usr/bin/python
# Written by Heiko 2019.02.07
# Will return the password change interval from Active Directory
import subprocess
result = subprocess.check_output( 'dsconfigad -show | grep \'Password change interval\' | awk \'{print $5}\' ', shell=True).strip()
print '<result>' + result + '</result>' | 0 | 0 | 0 |
73337f13b10e651882b6e4183226231bc29ca29f | 2,694 | py | Python | furiate.py | veox/furiate | 216aae2a81e9fa1135ba4860f915a9a418bc17a4 | [
"MIT"
] | 2 | 2018-03-23T19:15:55.000Z | 2022-03-15T00:18:34.000Z | furiate.py | veox/furiate | 216aae2a81e9fa1135ba4860f915a9a418bc17a4 | [
"MIT"
] | null | null | null | furiate.py | veox/furiate | 216aae2a81e9fa1135ba4860f915a9a418bc17a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import getpass
import time
from web3 import Web3, HTTPProvider
from eth_account import Account # will use directly instead of through web3 provider
from schedule import chainids, txs
print(len(txs), 'transactions in schedule.')
with open('infura.key') as keyfile:
infurakey = keyfile.read(... | 32.853659 | 101 | 0.646251 | #!/usr/bin/env python
import getpass
import time
from web3 import Web3, HTTPProvider
from eth_account import Account # will use directly instead of through web3 provider
from schedule import chainids, txs
print(len(txs), 'transactions in schedule.')
with open('infura.key') as keyfile:
infurakey = keyfile.read(... | 0 | 0 | 0 |
dcaa940af3143f7277cd5eb8ee34653746c22c71 | 450 | py | Python | psycopg2/scripts/makedocs.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 4 | 2021-10-17T11:17:59.000Z | 2022-02-28T16:58:40.000Z | psycopg2/scripts/makedocs.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 17 | 2021-10-05T21:44:06.000Z | 2022-03-31T16:58:40.000Z | psycopg2/scripts/makedocs.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 8 | 2021-09-02T18:55:49.000Z | 2022-03-09T21:05:28.000Z | #!/usr/bin/env python
"""Build documentation and api."""
import os
EPYDOC = "python c:/programmi/python23/scripts/epydoc.py"
PSYCOPG = "c:/programmi/python23/lib/site-packages/psycopg2"
os.system("python ext2html.py ../doc/extensions.rst > ../doc/extensions.html")
os.system("%s "
"-o ../doc/api "... | 28.125 | 79 | 0.6 | #!/usr/bin/env python
"""Build documentation and api."""
import os
EPYDOC = "python c:/programmi/python23/scripts/epydoc.py"
PSYCOPG = "c:/programmi/python23/lib/site-packages/psycopg2"
os.system("python ext2html.py ../doc/extensions.rst > ../doc/extensions.html")
os.system("%s "
"-o ../doc/api "... | 0 | 0 | 0 |