hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dbab62c1a1ca6e814009d0fd31cbbb9b77286668 | 205 | py | Python | requests_spider/logger.py | jayvdb/requests_spider | f4aa1f21880bd49b05e7cdbfcefa5a41a082e96c | [
"MIT"
] | 5 | 2019-01-11T01:43:53.000Z | 2019-08-04T16:05:40.000Z | requests_spider/logger.py | jayvdb/requests_spider | f4aa1f21880bd49b05e7cdbfcefa5a41a082e96c | [
"MIT"
] | 1 | 2020-01-31T03:57:59.000Z | 2020-02-02T07:15:59.000Z | requests_spider/logger.py | jayvdb/requests_spider | f4aa1f21880bd49b05e7cdbfcefa5a41a082e96c | [
"MIT"
] | 2 | 2019-08-04T16:05:39.000Z | 2020-01-31T03:06:22.000Z | import logging
logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s] - [%(levelname)s] - [Spider]- [%(message)s]',
datefmt='%Y/%m/%d %H:%M:%S')
logger = logging.getLogger(__name__)
| 20.5 | 71 | 0.62439 |
590813d31d166f23a3d836bf06a55445fc17c0f4 | 7,777 | py | Python | dj/scripts/gsocr.py | CarlFK/veyepar | 4337edf3a917cc4e8371f469d32669dd8c4d538b | [
"MIT"
] | 20 | 2015-02-01T23:37:03.000Z | 2021-12-07T16:32:41.000Z | dj/scripts/gsocr.py | yoe/veyepar | 440f7c0c907510a887c20f1dbddbc590d6065971 | [
"MIT"
] | 19 | 2015-01-03T05:19:33.000Z | 2020-06-05T17:27:41.000Z | dj/scripts/gsocr.py | yoe/veyepar | 440f7c0c907510a887c20f1dbddbc590d6065971 | [
"MIT"
] | 18 | 2015-01-17T12:19:09.000Z | 2021-11-20T19:03:08.000Z | #!/usr/bin/python
# gsocr.py
# uses gstreamer to send frames to gocr
"""
Start with every 5 seconds until we find more than 5 words
then check less and less as we get farther into the file,
and even less if we find more words.
(opposite of: spent more time if we can't find anything)
"""
import subprocess
import os
... | 31.48583 | 91 | 0.587502 |
007da28978ea75f8748d26eafe356386e5581c4b | 22,235 | py | Python | nova/tests/scheduler/test_host_manager.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | null | null | null | nova/tests/scheduler/test_host_manager.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | null | null | null | nova/tests/scheduler/test_host_manager.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 40.798165 | 79 | 0.636429 |
bc86f4b3b5f92fc3b069224559e233c0b837cbc9 | 136 | py | Python | 2019/01/01/Using the Inline Form Set Factory in Django (Part 1 of 2)/inlineformset_example/inlineexample/example/admin.py | kenjitagawa/youtube_video_code | ef3c48b9e136b3745d10395d94be64cb0a1f1c97 | [
"Unlicense"
] | 492 | 2019-06-25T12:54:31.000Z | 2022-03-30T12:38:28.000Z | 2019/01/01/Using the Inline Form Set Factory in Django (Part 1 of 2)/inlineformset_example/inlineexample/example/admin.py | kenjitagawa/youtube_video_code | ef3c48b9e136b3745d10395d94be64cb0a1f1c97 | [
"Unlicense"
] | 23 | 2019-10-01T01:36:08.000Z | 2022-02-10T12:46:16.000Z | 2019/01/01/Using the Inline Form Set Factory in Django (Part 1 of 2)/inlineformset_example/inlineexample/example/admin.py | kenjitagawa/youtube_video_code | ef3c48b9e136b3745d10395d94be64cb0a1f1c97 | [
"Unlicense"
] | 1,734 | 2019-06-03T06:25:13.000Z | 2022-03-31T23:57:53.000Z | from django.contrib import admin
from .models import Programmer, Language
admin.site.register(Programmer)
admin.site.register(Language) | 27.2 | 40 | 0.838235 |
f78b81b223377d750f7a0c41ed26ce9b6a80cd41 | 701 | py | Python | app/main/email.py | Jumballaya/save-energy-tx | 1aa75cfdabe169c05f845cd47e477560f5319883 | [
"FSFAP"
] | null | null | null | app/main/email.py | Jumballaya/save-energy-tx | 1aa75cfdabe169c05f845cd47e477560f5319883 | [
"FSFAP"
] | 7 | 2021-03-09T00:51:13.000Z | 2022-03-11T23:40:46.000Z | app/main/email.py | Jumballaya/save-energy-tx | 1aa75cfdabe169c05f845cd47e477560f5319883 | [
"FSFAP"
] | 1 | 2019-03-20T16:58:23.000Z | 2019-03-20T16:58:23.000Z | from flask import render_template, current_app
from app.email import send_email
# Email Verification Email
def send_moreinfo_email(email):
send_email('[Energy Savers] Information',
sender=current_app.config['ADMINS'][0],
recipients=email,
text_body=render_template('email/more_info/more_info... | 41.235294 | 74 | 0.733238 |
f26f52237c8be3e236c032ad3d1f58a1d380ff0c | 333 | py | Python | tests/test_liquimigrate.py | marcinn/liquimigrate | 59daa1e14cd98c78286a10917dff28dee069a23e | [
"BSD-3-Clause"
] | 3 | 2015-08-05T17:13:58.000Z | 2018-06-18T10:32:48.000Z | tests/test_liquimigrate.py | marcinn/liquimigrate | 59daa1e14cd98c78286a10917dff28dee069a23e | [
"BSD-3-Clause"
] | 10 | 2015-08-05T17:32:30.000Z | 2019-07-11T10:45:24.000Z | tests/test_liquimigrate.py | marcinn/liquimigrate | 59daa1e14cd98c78286a10917dff28dee069a23e | [
"BSD-3-Clause"
] | 3 | 2016-11-21T14:49:15.000Z | 2019-10-14T18:15:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_liquimigrate
----------------------------------
Tests for `liquimigrate` module.
"""
from datetime import datetime, timedelta
import os
import unittest
import liquimigrate
class TestLiquimigrate(unittest.TestCase):
def test_empty(self):
self.asse... | 15.136364 | 42 | 0.645646 |
56ac5e0f202575159bdea14673c1bcea43152f05 | 53 | py | Python | salonik/src/Salonik/MicroLecture/Ex00.py | michalrus/salonik | 7b29b60ffa9b1087360320507b67eb0d0fd69a3e | [
"Apache-2.0"
] | null | null | null | salonik/src/Salonik/MicroLecture/Ex00.py | michalrus/salonik | 7b29b60ffa9b1087360320507b67eb0d0fd69a3e | [
"Apache-2.0"
] | null | null | null | salonik/src/Salonik/MicroLecture/Ex00.py | michalrus/salonik | 7b29b60ffa9b1087360320507b67eb0d0fd69a3e | [
"Apache-2.0"
] | null | null | null | a = 5 - 1
a = a + 1
b = f(x,y)
g = lambda y: f(5,y)
| 8.833333 | 20 | 0.396226 |
eae2f12291150af1682621b9afa7dc4145f69778 | 10,178 | py | Python | tests/integration/cli/test_intents.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 3 | 2021-07-19T09:46:01.000Z | 2022-03-07T13:51:25.000Z | tests/integration/cli/test_intents.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 43 | 2019-08-27T12:36:29.000Z | 2020-08-27T14:50:40.000Z | tests/integration/cli/test_intents.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 7 | 2020-09-22T20:32:17.000Z | 2022-03-29T12:25:51.000Z | from .cli_test_base import CLIIntegrationTest
from typing import List, Any, Callable, Dict, Tuple
from lmctl.cli.entry import cli
from lmctl.client import TNCOClientHttpError
from lmctl.client.models import CreateAssemblyIntent, DeleteAssemblyIntent
import yaml
import os
import json
import time
class TestClusters(CLII... | 55.315217 | 190 | 0.661328 |
d7c80aef40584dd6899296be22f7979ab7ed0a34 | 2,292 | py | Python | python-snake-game.py | aditya270520/python-turtle-snake-game | 4fb2e5d81df75db525316e2a9ab59ac68f00ae62 | [
"MIT"
] | null | null | null | python-snake-game.py | aditya270520/python-turtle-snake-game | 4fb2e5d81df75db525316e2a9ab59ac68f00ae62 | [
"MIT"
] | null | null | null | python-snake-game.py | aditya270520/python-turtle-snake-game | 4fb2e5d81df75db525316e2a9ab59ac68f00ae62 | [
"MIT"
] | null | null | null | import turtle
import random
w = 500
h = 500
fs = 10
d = 100 # milliseconds
offsets = {
"up": (0, 20),
"down": (0, -20),
"left": (-20, 0),
"right": (20, 0)
}
def r():
global saap, kata, khanaT, pen
saap = [[0, 0], [0, 20], [0, 40], [0, 60], [0, 80]]
kata = "up"
khanaT = nun()
food... | 18.786885 | 55 | 0.516143 |
59da7056601d31abd11e0b18e92e3f0bae3d6e48 | 1,322 | py | Python | apps/TCPB_-_Bulk_DNS_Lookup/src/trap_exception.py | majacQ/threatconnect-playbooks | 81262fc732844f08d99649a795feb978f5ed6364 | [
"Apache-2.0"
] | null | null | null | apps/TCPB_-_Bulk_DNS_Lookup/src/trap_exception.py | majacQ/threatconnect-playbooks | 81262fc732844f08d99649a795feb978f5ed6364 | [
"Apache-2.0"
] | null | null | null | apps/TCPB_-_Bulk_DNS_Lookup/src/trap_exception.py | majacQ/threatconnect-playbooks | 81262fc732844f08d99649a795feb978f5ed6364 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Exception Trap Decorator"""
# standard library
import functools
import inspect
def trap(handler='handle_exception', classes=None):
"""Creates a trap handling decorator"""
if classes is not None and not isinstance(classes, (list, tuple)):
classes = (classes,)
def decorat... | 26.979592 | 70 | 0.487897 |
ff47a61c18905fd5d7e2148cb1efd66dd4c3fed0 | 3,224 | py | Python | dlscripts/href/BR_postage.py | wxenviz/wxenviz.github.io | 9fcba63e444426eb6a572a696af7fc4b00675240 | [
"MIT"
] | null | null | null | dlscripts/href/BR_postage.py | wxenviz/wxenviz.github.io | 9fcba63e444426eb6a572a696af7fc4b00675240 | [
"MIT"
] | null | null | null | dlscripts/href/BR_postage.py | wxenviz/wxenviz.github.io | 9fcba63e444426eb6a572a696af7fc4b00675240 | [
"MIT"
] | null | null | null | import ftplib
import glob
import subprocess as sp
import csv
import numpy as np
import netCDF4 as nc4
import pygrib as pg
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import datetime
import scipy
import os
import sys
from mpl_toolkits.basemap import Basemap
from matplotlib.patches import Polygon
from matp... | 38.380952 | 157 | 0.735422 |
56e8f4ed632c80a17e4a56beb98298eafc26f321 | 587 | py | Python | scrapeAllHyperlinksFromWebpage.py | bharath-blr/WebScrapers | bb235ec6b10d401ab5aee48b6787299fcaac6820 | [
"MIT"
] | null | null | null | scrapeAllHyperlinksFromWebpage.py | bharath-blr/WebScrapers | bb235ec6b10d401ab5aee48b6787299fcaac6820 | [
"MIT"
] | null | null | null | scrapeAllHyperlinksFromWebpage.py | bharath-blr/WebScrapers | bb235ec6b10d401ab5aee48b6787299fcaac6820 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import requests
from bs4 import BeautifulSoup
url = sys.argv[1]
print ("Scraping following webpage: %s" % url)
try:
response = requests.get(url)
except:
print ("Oops! That does not look like a valid url or cannot be scraped. Try with a new one")
sys.exit()
soup... | 29.35 | 97 | 0.65247 |
9b440f643129b51cbb3d3f0be7828746fe2ec091 | 1,421 | py | Python | Misc/ProjetoIAC.py | FunkyCracky/good_snaky_stuff | 7a99b5d4e9f5f3859770c6c85296c499f0b7599c | [
"MIT"
] | null | null | null | Misc/ProjetoIAC.py | FunkyCracky/good_snaky_stuff | 7a99b5d4e9f5f3859770c6c85296c499f0b7599c | [
"MIT"
] | null | null | null | Misc/ProjetoIAC.py | FunkyCracky/good_snaky_stuff | 7a99b5d4e9f5f3859770c6c85296c499f0b7599c | [
"MIT"
] | null | null | null | #Realizado por David Belchior e Hugo Ribeiro, LEIC-A, Numeros 95550 e 95590
def movimento (ang, v0, x0, tempo, disc):
if not ((isinstance(ang, int) or isinstance(ang, float)) and 0 <= ang <= 90 and (isinstance(v0, int) or isinstance(v0, float)) and (isinstance(x0, int) or isinstance(x0, float)) and (isinstance(te... | 49 | 295 | 0.588318 |
c3965b11a5dc6b1f6703408e7593a21c21931a78 | 1,350 | py | Python | auxiliary/templatetags/common_visual_elements.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 69 | 2015-02-03T12:02:56.000Z | 2022-02-16T13:08:01.000Z | auxiliary/templatetags/common_visual_elements.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 446 | 2015-01-01T11:10:33.000Z | 2021-11-01T08:15:39.000Z | auxiliary/templatetags/common_visual_elements.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | 67 | 2015-01-01T09:13:58.000Z | 2021-11-01T07:51:08.000Z | from django import template
from django.utils.translation import ugettext as _
register = template.Library()
@register.inclusion_tag('auxiliary/_bar.html')
def bar(quantity, start, end, bar_class=None, show_label=True):
"""
Draws a bar.
:param quantity: The quantity to represent
:param start: Start ... | 28.125 | 80 | 0.608148 |
5c0cf48ce0d0259e6543fd0a3cd2b246b775555c | 1,259 | py | Python | tests/unit/properties/non_scalar/test_band_structure.py | Exabyte-io/exabyte-express | 579cc1ad3666352848e0ac8eeec84cb410a9a9c7 | [
"Apache-2.0"
] | null | null | null | tests/unit/properties/non_scalar/test_band_structure.py | Exabyte-io/exabyte-express | 579cc1ad3666352848e0ac8eeec84cb410a9a9c7 | [
"Apache-2.0"
] | null | null | null | tests/unit/properties/non_scalar/test_band_structure.py | Exabyte-io/exabyte-express | 579cc1ad3666352848e0ac8eeec84cb410a9a9c7 | [
"Apache-2.0"
] | null | null | null | from mock import MagicMock
from tests.unit import UnitTestBase
from express.properties.non_scalar.two_dimensional_plot.band_structure import BandStructure
from tests.fixtures.data import BAND_STRUCTURE, HSE_EIGENVALUES_AT_KPOINTS, HSE_BAND_STRUCTURE, EIGENVALUES_AT_KPOINTS
class BandStructureTest(UnitTestBase):
... | 44.964286 | 118 | 0.77363 |
ab2c9e68a40b5a227769cc4deeaf644baaf2aa18 | 158 | py | Python | diagram/diagram.py | JamesWoolfenden/terraform-gcp-storage | 42f431a0de1f64ae5e2e6ea8ab82c818064bc6e8 | [
"Apache-2.0"
] | null | null | null | diagram/diagram.py | JamesWoolfenden/terraform-gcp-storage | 42f431a0de1f64ae5e2e6ea8ab82c818064bc6e8 | [
"Apache-2.0"
] | 2 | 2019-10-22T16:00:55.000Z | 2020-09-29T12:58:05.000Z | diagram/diagram.py | JamesWoolfenden/terraform-gcp-storage | 42f431a0de1f64ae5e2e6ea8ab82c818064bc6e8 | [
"Apache-2.0"
] | 1 | 2022-02-22T04:40:29.000Z | 2022-02-22T04:40:29.000Z | # diagram.py
from diagrams import Cluster, Diagram
from diagrams.gcp.storage import Storage
with Diagram("GCP storage", show=False):
Storage("Bucket")
| 22.571429 | 41 | 0.753165 |
1c552588130bd5ad11e1e5233a98130d12a4d3a2 | 322 | py | Python | python/flatbuffers/reflection/AdvancedFeatures.py | sssooonnnggg/flatbuffers | 0e60cf1ce20803fe202006b15e752f72039f8e9e | [
"Apache-2.0"
] | null | null | null | python/flatbuffers/reflection/AdvancedFeatures.py | sssooonnnggg/flatbuffers | 0e60cf1ce20803fe202006b15e752f72039f8e9e | [
"Apache-2.0"
] | null | null | null | python/flatbuffers/reflection/AdvancedFeatures.py | sssooonnnggg/flatbuffers | 0e60cf1ce20803fe202006b15e752f72039f8e9e | [
"Apache-2.0"
] | 1 | 2022-02-20T03:16:42.000Z | 2022-02-20T03:16:42.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: reflection
# New schema language features that are not supported by old code generators.
class AdvancedFeatures(object):
AdvancedArrayFeatures = 1
AdvancedUnionFeatures = 2
OptionalScalars = 4
DefaultVectorsAndStrings = ... | 29.272727 | 77 | 0.779503 |
6ddca1ba59b5b8f5f878d8ae51c535ffa490a333 | 3,841 | py | Python | src/pyaC/importCheck.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 98 | 2015-01-01T12:46:05.000Z | 2022-02-13T14:17:36.000Z | src/pyaC/importCheck.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 46 | 2015-02-10T19:53:38.000Z | 2022-01-11T17:26:05.000Z | src/pyaC/importCheck.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 38 | 2015-01-08T17:00:34.000Z | 2022-03-04T05:15:22.000Z | from . import pyaErrors as PE
import importlib
def pyaimportallfrom(mn, pak, globs, cra=False, rf=False, re=False):
"""
Mimics the behavior of 'from X import *'.
Get some help here.
# https://stackoverflow.com/questions/21221358/python-how-to-import-all-methods-and-attributes-from-a-module-dynamicall... | 33.4 | 124 | 0.538662 |
7422e443cb87a62a44cd68f9ca3c94325acde368 | 1,437 | py | Python | examples/rooks/rooks.py | kai-pischke/python-constraint | e23fe9852cddddf1c3e258e03f2175df24b4c702 | [
"BSD-2-Clause"
] | 303 | 2015-12-02T07:09:05.000Z | 2022-03-09T15:03:43.000Z | examples/rooks/rooks.py | kai-pischke/python-constraint | e23fe9852cddddf1c3e258e03f2175df24b4c702 | [
"BSD-2-Clause"
] | 58 | 2015-10-04T07:53:43.000Z | 2022-01-04T11:40:09.000Z | examples/rooks/rooks.py | kai-pischke/python-constraint | e23fe9852cddddf1c3e258e03f2175df24b4c702 | [
"BSD-2-Clause"
] | 70 | 2016-03-06T21:20:42.000Z | 2022-02-08T00:26:08.000Z | #!/usr/bin/python
#
# http://mathworld.wolfram.com/RooksProblem.html
#
from constraint import Problem
import sys
def factorial(x):
return x == 1 or factorial(x - 1) * x
def solve(size):
problem = Problem()
cols = range(size)
rows = range(size)
problem.addVariables(cols, rows)
for col1 in col... | 25.210526 | 84 | 0.530271 |
b636f00097b4bb68f3334f667692d9499adfca1b | 69,085 | py | Python | aiida/orm/nodes/data/array/bands.py | pranavmodx/aiida-core | 0edbbf82dfb97ab130914d1674a6f2217eba5971 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | aiida/orm/nodes/data/array/bands.py | pranavmodx/aiida-core | 0edbbf82dfb97ab130914d1674a6f2217eba5971 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | aiida/orm/nodes/data/array/bands.py | pranavmodx/aiida-core | 0edbbf82dfb97ab130914d1674a6f2217eba5971 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 39.141643 | 121 | 0.613592 |
9c10892ed10727c78568fbc0c922c88ddf97862a | 353 | py | Python | backend/django_app/core/admin/__init__.py | bekurmann/BA_polity | 933c9df9d935066cc498c5da8e1e0f68742f6ee5 | [
"MIT"
] | null | null | null | backend/django_app/core/admin/__init__.py | bekurmann/BA_polity | 933c9df9d935066cc498c5da8e1e0f68742f6ee5 | [
"MIT"
] | null | null | null | backend/django_app/core/admin/__init__.py | bekurmann/BA_polity | 933c9df9d935066cc498c5da8e1e0f68742f6ee5 | [
"MIT"
] | null | null | null | from .politican import PoliticanAdmin
from .party import PartyAdmin
from .parlament import ParlamentAdmin
from .commission import CommissionAdmin
from .fraction import FractionAdmin
from .topic import TopicAdmin
from .affair import AffairAdmin, AffairDebateAdmin, AffairFileAdmin
from .session import SessionAdmin
from .... | 39.222222 | 67 | 0.864023 |
04232ff6f354dc4f74d1833ec08017a4a316871a | 1,844 | py | Python | test/chora/scripts/tooldefs/tool_viap.py | jbreck/duet-jbreck | 3bf4aa0c69983d15f199bf02f294d356c354e932 | [
"MIT"
] | 1 | 2020-08-15T15:26:25.000Z | 2020-08-15T15:26:25.000Z | test/chora/scripts/tooldefs/tool_viap.py | jbreck/duet-jbreck | 3bf4aa0c69983d15f199bf02f294d356c354e932 | [
"MIT"
] | null | null | null | test/chora/scripts/tooldefs/tool_viap.py | jbreck/duet-jbreck | 3bf4aa0c69983d15f199bf02f294d356c354e932 | [
"MIT"
] | null | null | null | import choraconfig, re, sys, os.path, subprocess
def viap_precheck(params) :
prpfiles = [F for F in os.listdir(params["directory"]) if F.endswith(".prp")]
if len(prpfiles) != 1 :
print "testing.py / tool_viap.py : Error: could not find a unique .prp file in " + params["directory"]
print "Maybe ... | 42.883721 | 124 | 0.663774 |
4f070f078da8aa1833d9273f2709bb1a9ec4401d | 4,070 | py | Python | bagpipe/bgp/vpn/ipvpn/__init__.py | ThomasHeinlein/bagpipe-bgp | f196da35b00925a0743b38243773e528fc5b122f | [
"Apache-2.0"
] | null | null | null | bagpipe/bgp/vpn/ipvpn/__init__.py | ThomasHeinlein/bagpipe-bgp | f196da35b00925a0743b38243773e528fc5b122f | [
"Apache-2.0"
] | null | null | null | bagpipe/bgp/vpn/ipvpn/__init__.py | ThomasHeinlein/bagpipe-bgp | f196da35b00925a0743b38243773e528fc5b122f | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... | 37 | 78 | 0.642998 |
96e139bf5da4a9c95edd3b1bdf8f088ed7966510 | 1,408 | py | Python | lintcode/533.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | 1 | 2021-01-08T06:57:49.000Z | 2021-01-08T06:57:49.000Z | lintcode/533.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | null | null | null | lintcode/533.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | 1 | 2021-01-08T06:57:52.000Z | 2021-01-08T06:57:52.000Z | """
533. Two Sum - Closest to target
[-1, 2, 1, -4] and target = 4
-4, -1, 3, 9, 10
^ ^
6 4 2 > 0
5 4 1 > 0
-1 4 3 < 0
whenever the sign flipped, the search can stop
or if the diff becomes bigger, the search can stop
"""
import sys
class Solution:
"""
@param nums: an integer array
@param ... | 27.607843 | 69 | 0.514915 |
3e99616ac88d742b8769bbb0f8374b362749400c | 10,085 | py | Python | functions.py | sleepingslipper/cube_bot | 8463912001b75015340b6a6dd6e7df0e2917df88 | [
"Apache-2.0"
] | null | null | null | functions.py | sleepingslipper/cube_bot | 8463912001b75015340b6a6dd6e7df0e2917df88 | [
"Apache-2.0"
] | null | null | null | functions.py | sleepingslipper/cube_bot | 8463912001b75015340b6a6dd6e7df0e2917df88 | [
"Apache-2.0"
] | null | null | null | from utils.mydb import *
from utils.user import User
from aiogram import types
import datetime
import random
import texts
import menu
import config
import requests
import json
import time
buy_dict = {}
class Buy:
def __init__(self, user_id):
self.user_id = user_id
self.product_code = None
asy... | 26.821809 | 204 | 0.585821 |
2712f69ee4c2df0b616a043834f823787e03007e | 2,601 | py | Python | SMSProject/venv/Lib/site-packages/test/fonts/test_font_remap.py | LourencoFernando/SMS-Project | f8e13dafdb41aa01f79337819cc3033a532410e8 | [
"MIT"
] | null | null | null | SMSProject/venv/Lib/site-packages/test/fonts/test_font_remap.py | LourencoFernando/SMS-Project | f8e13dafdb41aa01f79337819cc3033a532410e8 | [
"MIT"
] | null | null | null | SMSProject/venv/Lib/site-packages/test/fonts/test_font_remap.py | LourencoFernando/SMS-Project | f8e13dafdb41aa01f79337819cc3033a532410e8 | [
"MIT"
] | null | null | null | from pathlib import Path
from fpdf import FPDF
from fpdf.fpdf import SubsetMap
from test.conftest import assert_pdf_equal
HERE = Path(__file__).resolve().parent
def test_subset_map():
subset_map = SubsetMap(range(0, 1024, 2))
assert len(subset_map.dict()) == 512
for i in range(0, 1024, 2):
asse... | 27.967742 | 76 | 0.660515 |
040d112d3473ea800f2d9a32260cacf30f8a2d09 | 9,449 | py | Python | src/orion/core/io/database/__init__.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 4 | 2020-03-25T17:44:40.000Z | 2020-04-10T13:53:13.000Z | src/orion/core/io/database/__init__.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 2 | 2018-06-26T19:17:09.000Z | 2022-02-23T13:40:04.000Z | src/orion/core/io/database/__init__.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 2 | 2019-08-26T11:36:47.000Z | 2020-04-07T13:05:48.000Z | # -*- coding: utf-8 -*-
"""
:mod:`orion.core.io.database` -- Wrappers for database frameworks
=================================================================
.. module:: database
:platform: Unix
:synopsis: Import name for wrappers of database frameworks.
Contains :class:`AbstractDB`, an interface for database... | 29.25387 | 98 | 0.607048 |
c8a056b29188c821781eeddb3e8899295af40273 | 529 | py | Python | requests_oauthlib/__init__.py | scovetta/requests-oauthlib | 36f24b494a146c60c47bfcdf5a0ae5fbc9a608b9 | [
"ISC"
] | null | null | null | requests_oauthlib/__init__.py | scovetta/requests-oauthlib | 36f24b494a146c60c47bfcdf5a0ae5fbc9a608b9 | [
"ISC"
] | 1 | 2019-09-18T09:53:29.000Z | 2019-09-18T09:53:29.000Z | requests_oauthlib/__init__.py | scovetta/requests-oauthlib | 36f24b494a146c60c47bfcdf5a0ae5fbc9a608b9 | [
"ISC"
] | null | null | null | import logging
from .oauth1_auth import OAuth1
from .oauth1_session import OAuth1Session
from .oauth2_auth import OAuth2
from .oauth2_session import OAuth2Session, TokenUpdated
__version__ = "1.2.0"
import requests
if requests.__version__ < "2.0.0":
msg = (
"You are using requests version %s, which is o... | 26.45 | 72 | 0.744802 |
4fb9580963a4a28984ccb9594c29252153e1a30c | 1,508 | py | Python | sdk/python/pulumi_azure/__init__.py | pulumi-bot/pulumi-azure | 64d5c30a77b3f4de117068add359ef85293cef8e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/__init__.py | pulumi-bot/pulumi-azure | 64d5c30a77b3f4de117068add359ef85293cef8e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/__init__.py | pulumi-bot/pulumi-azure | 64d5c30a77b3f4de117068add359ef85293cef8e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import importlib
# Make subpackages available:
__all__ = ['advisor', 'analysisservices', 'apimanagement', 'appconfiguration', 'appinsig... | 107.714286 | 1,109 | 0.697613 |
57cd45586ec961a3bc55b2024bf6c83643d5c1c1 | 3,907 | py | Python | audio.py | sdickreuter/ToneGen | 69c554c7207563a69479202349061e1f8ef4f328 | [
"MIT"
] | 1 | 2020-09-18T20:27:50.000Z | 2020-09-18T20:27:50.000Z | audio.py | sdickreuter/ToneGen | 69c554c7207563a69479202349061e1f8ef4f328 | [
"MIT"
] | null | null | null | audio.py | sdickreuter/ToneGen | 69c554c7207563a69479202349061e1f8ef4f328 | [
"MIT"
] | null | null | null | import sounddevice as sd
import numpy as np
#import threading as mp
import billiard as mp
mp.forking_enable(False)
import queue
import shepard as shepard
import tones
default_device = sd.query_hostapis(0)['default_output_device']
devices = sd.query_devices()
device_names = []
device_indices = []
devices_defaultsampl... | 30.76378 | 154 | 0.607371 |
0246d1e6b1587f3cea01039c1c1ecc366ccf1b4c | 937 | py | Python | main.py | zz824865454/Orbbec_Astra_Pro-python-OpenCV_OpenNI | 7a2f2db9b0f045339a45a7ffd32c4c5e62347b9b | [
"MIT"
] | null | null | null | main.py | zz824865454/Orbbec_Astra_Pro-python-OpenCV_OpenNI | 7a2f2db9b0f045339a45a7ffd32c4c5e62347b9b | [
"MIT"
] | null | null | null | main.py | zz824865454/Orbbec_Astra_Pro-python-OpenCV_OpenNI | 7a2f2db9b0f045339a45a7ffd32c4c5e62347b9b | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from OpenNIClass import OpenniClass
# 输入openni redist文件夹路径
astra = OpenniClass("./OpenNI-Linux-Arm64-2.3.0.66/Redist")
def mousecallback(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDBLCLK:
print(y, x, depthImg[y, x])
if __name__ == "__main__":
cv2.namedWind... | 22.309524 | 59 | 0.612593 |
7efa604e6862ba48b4bfaf25a84cd5321395075f | 301 | py | Python | Alphabet/CaptialAlphabet/Static_cap_letter_while_loop/WHILE_LOOP_K.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | Alphabet/CaptialAlphabet/Static_cap_letter_while_loop/WHILE_LOOP_K.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | Alphabet/CaptialAlphabet/Static_cap_letter_while_loop/WHILE_LOOP_K.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | #K
row=0
while row<8:
col =0
while col<9:
if (col==0 or row==col+3)or (col==1 and row==3)or(row==2 and col==2)or (row==1 and col==3) or (row==0 and col==4):
print("*",end=" ")
else:
print(" ",end=" ")
col +=1
row +=1
print()
| 23.153846 | 123 | 0.421927 |
2ff67d6ad5df866796c3ce1eec4205a0e7e280fd | 1,551 | py | Python | ch06/train_better_rnnlm.py | Yuansurex/DL-NLP | 1d04cf92b469377e43bd0dd28c4b1f2f1e0bbb8f | [
"MIT"
] | 2 | 2021-05-23T09:35:07.000Z | 2021-12-27T05:16:52.000Z | ch06/train_better_rnnlm.py | Yuansurex/DL-NLP | 1d04cf92b469377e43bd0dd28c4b1f2f1e0bbb8f | [
"MIT"
] | null | null | null | ch06/train_better_rnnlm.py | Yuansurex/DL-NLP | 1d04cf92b469377e43bd0dd28c4b1f2f1e0bbb8f | [
"MIT"
] | null | null | null | # coding: utf-8
import sys
sys.path.append('..')
from common import config
# 在用GPU运行时,请打开下面的注释(需要cupy)
# ==============================================
# config.GPU = True
# ==============================================
from common.optimizer import SGD
from common.trainer import RnnlmTrainer
from common.util import ev... | 23.149254 | 67 | 0.660864 |
ce265a842b51e5ecadcee9dee7d82221e4c9405b | 2,274 | py | Python | src/audiofile.py | sjsafranek/remixer | 2ed7cdcc0e5869b83e65e145677550601ea55301 | [
"MIT"
] | null | null | null | src/audiofile.py | sjsafranek/remixer | 2ed7cdcc0e5869b83e65e145677550601ea55301 | [
"MIT"
] | null | null | null | src/audiofile.py | sjsafranek/remixer | 2ed7cdcc0e5869b83e65e145677550601ea55301 | [
"MIT"
] | null | null | null |
import time
import sys
import fleep
from tinytag import TinyTag
from pydub import AudioSegment
class AudioFile(object):
def __init__(self, filename):
self._filename = filename
# get file info
with open(self.filename, "rb") as file:
self._info = fleep.get(file.read(128))
... | 27.731707 | 98 | 0.635004 |
1b11d13f5fb6e232e8b6c0f45503c243fcb9de51 | 1,425 | py | Python | 24/hackerrank24.py | adamkkarl/ProjectEuler | 767286c74a484b7a569d6060ab6d54a298195aa3 | [
"MIT"
] | 2 | 2018-05-07T00:16:57.000Z | 2018-05-22T02:57:16.000Z | 24/hackerrank24.py | adamkkarl/ProjectEuler | 767286c74a484b7a569d6060ab6d54a298195aa3 | [
"MIT"
] | null | null | null | 24/hackerrank24.py | adamkkarl/ProjectEuler | 767286c74a484b7a569d6060ab6d54a298195aa3 | [
"MIT"
] | null | null | null | #!/bin/python3
__author__ = "Adam Karl"
"""What is the Nth lexiographic permutation of abcdefghijklm"""
#https://www.hackerrank.com/contests/projecteuler/challenges/euler024/problem
#first line T number of test cases, followed by T lines of N values
#constraints: 1 <= T <= 1000; 1 <= N <= 13!
factorials = []
def gen... | 26.388889 | 77 | 0.568421 |
23eddcaa5455d8f74a2703ae7043277fee2bf034 | 186 | py | Python | packages/gtmcore/gtmcore/gitlib/__init__.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/gitlib/__init__.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/gitlib/__init__.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | from gtmcore.gitlib.git import get_git_interface, GitAuthor, GitRepoInterface
from gtmcore.gitlib.git_fs import GitFilesystem
from gtmcore.gitlib.git_fs_shim import GitFilesystemShimmed
| 46.5 | 77 | 0.88172 |
3f0008e7673f715bc38476af0910a122011a9572 | 2,749 | py | Python | openGaussBase/testcase/SECURITY/AUDITING/Opengauss_Function_Security_Auditing_Case0100.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/AUDITING/Opengauss_Function_Security_Auditing_Case0100.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/AUDITING/Opengauss_Function_Security_Auditing_Case0100.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 35.24359 | 84 | 0.652601 |
a961020824286daa589a976c05fc92608aa0c553 | 851 | py | Python | populating_next_right_pointers_in_each_node_ii_117.py | danielsunzhongyuan/my_leetcode_in_python | 34d34280170c991ea7a28d74a3f2338753844917 | [
"Apache-2.0"
] | null | null | null | populating_next_right_pointers_in_each_node_ii_117.py | danielsunzhongyuan/my_leetcode_in_python | 34d34280170c991ea7a28d74a3f2338753844917 | [
"Apache-2.0"
] | null | null | null | populating_next_right_pointers_in_each_node_ii_117.py | danielsunzhongyuan/my_leetcode_in_python | 34d34280170c991ea7a28d74a3f2338753844917 | [
"Apache-2.0"
] | null | null | null | # Definition for binary tree with next pointer.
# class TreeLinkNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution:
# @param root, a tree link node
# @return nothing
def connect(self, root):
if n... | 27.451613 | 47 | 0.451234 |
063422a72826b2fa77b3ae9d04d0abbc4926b60c | 4,511 | py | Python | hdltools/abshdl/assign.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 2 | 2020-02-28T13:02:39.000Z | 2021-06-30T09:15:35.000Z | hdltools/abshdl/assign.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 1 | 2020-03-22T17:32:45.000Z | 2020-03-23T15:43:39.000Z | hdltools/abshdl/assign.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | null | null | null | """Assignment."""
from . import HDLObject
from .const import HDLIntegerConstant
from .expr import HDLExpression
from .signal import HDLSignal, HDLSignalSlice
from .concat import HDLConcatenation
from .stmt import HDLStatement
from .port import HDLModulePort
from .ifelse import HDLIfExp
from .macro import HDLMacroValue... | 31.326389 | 77 | 0.54622 |
fecbdb8490489676e12205316b33f351d2d6299f | 4,199 | py | Python | xoto3/cloudwatch/insights.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 16 | 2020-05-23T15:23:38.000Z | 2022-03-18T19:28:37.000Z | xoto3/cloudwatch/insights.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 9 | 2020-08-19T23:08:36.000Z | 2021-10-06T17:16:35.000Z | xoto3/cloudwatch/insights.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 2 | 2020-12-12T08:23:53.000Z | 2021-09-03T20:25:54.000Z | import typing as ty
from datetime import datetime
from functools import partial
import string
import uuid
import os
from xoto3.utils.dt import iso8601strict
from xoto3.lam.types import LambdaContext
from .utils import (
_DEFAULT_REGION,
regioned_url,
lambda_time_with_margin,
safe_log,
default_star... | 29.570423 | 99 | 0.684925 |
31d27afea5793a54dcf957bcdd7464dc8e5efb59 | 11,486 | py | Python | riptable/tests/test_categorical_ordered.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 307 | 2020-08-27T20:25:11.000Z | 2022-03-08T15:51:19.000Z | riptable/tests/test_categorical_ordered.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 206 | 2020-08-17T19:07:15.000Z | 2022-03-18T11:53:55.000Z | riptable/tests/test_categorical_ordered.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 10 | 2020-08-28T00:22:05.000Z | 2021-04-30T20:22:28.000Z | from riptable import *
from riptable.rt_enum import GROUPBY_KEY_PREFIX
str_list = ['b', 'b', 'a', 'c', 'b']
str_sorted = ['a', 'b', 'c']
str_unsorted = ['b', 'a', 'c']
int_list = [20, 20, 10, 30, 20]
int_sorted = [10, 20, 30]
int_unsorted = [20, 10, 30]
flt_list = [20.0, 20.0, 10.0, 30.0, 20.0]
flt_sorte... | 43.180451 | 121 | 0.642695 |
9e92066c1b28a00554029c00afc192c9c2cae0a7 | 14,198 | py | Python | analyzer/linux/analyzer.py | xuna123/Bold-Falcon | bef7dfc3103143bd51ca82838565877097fecc49 | [
"BSD-3-Clause"
] | 1 | 2021-06-22T05:33:08.000Z | 2021-06-22T05:33:08.000Z | analyzer/linux/analyzer.py | xuna123/Bold-Falcon | bef7dfc3103143bd51ca82838565877097fecc49 | [
"BSD-3-Clause"
] | null | null | null | analyzer/linux/analyzer.py | xuna123/Bold-Falcon | bef7dfc3103143bd51ca82838565877097fecc49 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2015-2017 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import sys
import pkgutil
import logging
import tempfile
import xmlrpclib
import traceback
import urllib
import urllib2
import time
import da... | 37.070496 | 97 | 0.55867 |
5f7f6128b15fe35ecce75a87520204e72080b428 | 3,557 | py | Python | bindings/python/ensmallen/datasets/string/corynebacteriumappendiciscip107643.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/corynebacteriumappendiciscip107643.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/corynebacteriumappendiciscip107643.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Corynebacterium appendicis CIP 107643.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: p... | 33.87619 | 223 | 0.683722 |
5409e0fa3721df07e88e3d8604085525d428e536 | 13,515 | py | Python | utils.py | Dolado/fma | e67c9466568523a591ce956888212b0ff134a51c | [
"MIT"
] | null | null | null | utils.py | Dolado/fma | e67c9466568523a591ce956888212b0ff134a51c | [
"MIT"
] | null | null | null | utils.py | Dolado/fma | e67c9466568523a591ce956888212b0ff134a51c | [
"MIT"
] | null | null | null |
import pydot
import requests
import numpy as np
import pandas as pd
import ctypes
import shutil
import multiprocessing
import multiprocessing.sharedctypes as sharedctypes
import os.path
import ast
import subprocess as sp
# Number of samples per 30s audio clip.
# TODO: fix dataset to be constant.
NB_AUDIO_SAMPLES = 1... | 34.21519 | 114 | 0.558787 |
07044fe96a0e7bae80cc6e0c933e0d5bd9a5cc7a | 1,437 | py | Python | tictoc.py | itsayellow/tictoc | e98624f2eb34313ae3892c56d289dd16d94ae45e | [
"MIT"
] | null | null | null | tictoc.py | itsayellow/tictoc | e98624f2eb34313ae3892c56d289dd16d94ae45e | [
"MIT"
] | null | null | null | tictoc.py | itsayellow/tictoc | e98624f2eb34313ae3892c56d289dd16d94ae45e | [
"MIT"
] | null | null | null | import time
import datetime
class Timer:
def __init__(self):
self.start_time = time.time()
def start(self):
"""Start this timer."""
self.start_time = time.time()
def eltime(self):
"""Return number of seconds since start()
Returns:
float: number of sec... | 30.574468 | 87 | 0.60682 |
df7f57f94d564a4a19793077631a805c91796e04 | 9,501 | py | Python | openstack/cloud_eye/v1/_proxy.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 43 | 2018-12-19T08:39:15.000Z | 2021-07-21T02:45:43.000Z | openstack/cloud_eye/v1/_proxy.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 11 | 2019-03-17T13:28:56.000Z | 2020-09-23T23:57:50.000Z | openstack/cloud_eye/v1/_proxy.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 47 | 2018-12-19T05:14:25.000Z | 2022-03-19T15:28:30.000Z | # -*- coding:utf-8 -*-
# Copyright 2018 Huawei Technologies Co.,Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 43.186364 | 81 | 0.563414 |
179d5ec6d6565d48232358b076ef7ba99b09e913 | 4,970 | py | Python | accel/metal/ops_metal.py | cjg91/tinygrad | 32d42c2667ce7e7231fc9197f2975eafb2663935 | [
"MIT"
] | 5,578 | 2020-10-18T16:26:28.000Z | 2022-03-31T18:31:04.000Z | accel/metal/ops_metal.py | JunnYu/tinygrad | c0c2c0b0414dec0862aa442c60e905f39958f572 | [
"MIT"
] | 219 | 2020-10-18T19:50:39.000Z | 2022-03-01T16:54:53.000Z | accel/metal/ops_metal.py | JunnYu/tinygrad | c0c2c0b0414dec0862aa442c60e905f39958f572 | [
"MIT"
] | 746 | 2020-10-18T20:09:37.000Z | 2022-03-30T10:11:46.000Z | # pip3 install pyobjc-framework-MetalPerformanceShaders
from tinygrad.tensor import Function
from tinygrad.helpers import binary_broadcast
import numpy as np
import Metal
import MetalPerformanceShaders
device = Metal.MTLCreateSystemDefaultDevice()
mtl_queue = device.newCommandQueue()
mtl_buffers = []
def cmd_buffer()... | 31.257862 | 162 | 0.74668 |
36c9b9c3b8a1074fd21c2173b9ba204186ee5dad | 9,186 | py | Python | pupy/foreign.py | jessekrubin/pup | 2cab5da7b1b39453c44be556b691db83442b0565 | [
"BSD-2-Clause"
] | 2 | 2019-03-07T09:26:36.000Z | 2019-07-31T17:24:23.000Z | pupy/foreign.py | jessekrubin/pup | 2cab5da7b1b39453c44be556b691db83442b0565 | [
"BSD-2-Clause"
] | 2 | 2019-10-26T02:29:54.000Z | 2021-06-25T15:28:12.000Z | pupy/foreign.py | jessekrubin/pup | 2cab5da7b1b39453c44be556b691db83442b0565 | [
"BSD-2-Clause"
] | 1 | 2019-07-31T17:24:32.000Z | 2019-07-31T17:24:32.000Z | # -*- coding: utf-8 -*-
# Pretty ~ Useful ~ Python
"""
==========
Iter Funks
==========
foreign => 'for ... in ...' (its a pun)
"""
from collections import Counter
from collections import deque
from functools import reduce
from itertools import chain
from itertools import tee
from operator import mul
from os import ge... | 24.894309 | 88 | 0.553233 |
8d01c0b37022aa8dc828db45dd39b7f0e934f2e0 | 40,766 | py | Python | google/cloud/dialogflow_v2/services/conversation_profiles/client.py | reichenbch/python-dialogflow | 74a54c6fd9d6e03741206ff1e95939123362cab9 | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflow_v2/services/conversation_profiles/client.py | reichenbch/python-dialogflow | 74a54c6fd9d6e03741206ff1e95939123362cab9 | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflow_v2/services/conversation_profiles/client.py | reichenbch/python-dialogflow | 74a54c6fd9d6e03741206ff1e95939123362cab9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 43.506937 | 140 | 0.646985 |
781de308fc0b8fd779b0fc7f115d608501c23abc | 16,759 | py | Python | fast_jtnn/chemutils.py | baohq1595/vae-jt | eb35c73458dff160b2319b73a5aa8fdc1a8b3783 | [
"MIT"
] | 1 | 2020-02-06T12:56:33.000Z | 2020-02-06T12:56:33.000Z | fast_jtnn/chemutils.py | baohq1595/vae-jt | eb35c73458dff160b2319b73a5aa8fdc1a8b3783 | [
"MIT"
] | null | null | null | fast_jtnn/chemutils.py | baohq1595/vae-jt | eb35c73458dff160b2319b73a5aa8fdc1a8b3783 | [
"MIT"
] | null | null | null | import rdkit
import rdkit.Chem as Chem
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from collections import defaultdict
from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers, StereoEnumerationOptions
from fast_jtnn.vocab import Vocab
MST_MAX_WEIGHT = 100
MA... | 38.974419 | 440 | 0.60296 |
8e5e269022025ef3a82a0269954c0db3d3478d44 | 5,018 | py | Python | src/oscar/apps/search/facets.py | frmdstryr/django-oscar | 32bf8618ebb688df6ba306dc7703de8e61b4e78c | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/search/facets.py | frmdstryr/django-oscar | 32bf8618ebb688df6ba306dc7703de8e61b4e78c | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/search/facets.py | frmdstryr/django-oscar | 32bf8618ebb688df6ba306dc7703de8e61b4e78c | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
from django.conf import settings
from haystack.query import SearchQuerySet
from purl import URL
def base_sqs():
"""
Return the base SearchQuerySet for Haystack searches.
"""
sqs = SearchQuerySet()
for facet in settings.OSCAR_SEARCH_FACETS['fields'].values():
... | 40.467742 | 79 | 0.558589 |
e74d372d3ec25fab48370e15f75459d7e70ba58c | 3,656 | py | Python | Module9/BlackJack/deck.py | xm4dn355x/specialist_python3_2nd_lvl | 4ea8c82eb0f32aa92c82914f6599c2c47a2f7032 | [
"MIT"
] | null | null | null | Module9/BlackJack/deck.py | xm4dn355x/specialist_python3_2nd_lvl | 4ea8c82eb0f32aa92c82914f6599c2c47a2f7032 | [
"MIT"
] | null | null | null | Module9/BlackJack/deck.py | xm4dn355x/specialist_python3_2nd_lvl | 4ea8c82eb0f32aa92c82914f6599c2c47a2f7032 | [
"MIT"
] | null | null | null | import random
class Card:
"""Игральная карта"""
HEARTS = 'Hearts'
DIAMONDS = 'Diamonds'
SPADES = 'Spades'
CLUBS = 'Clubs'
SUITS = [CLUBS, SPADES, DIAMONDS, HEARTS]
ICONS = ['♠', '♣', '♦', '♥']
VALUES = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
def __init__... | 28.5625 | 103 | 0.60093 |
9d240854b44c7c1907cd9a18acd482669612b1f1 | 128 | py | Python | example/code.py | truedl/pytojs | d589b5fea2d5ac58d151a01b5e54d7b4210d531f | [
"MIT"
] | 1 | 2021-03-10T02:21:04.000Z | 2021-03-10T02:21:04.000Z | example/code.py | truedl/pytojs | d589b5fea2d5ac58d151a01b5e54d7b4210d531f | [
"MIT"
] | null | null | null | example/code.py | truedl/pytojs | d589b5fea2d5ac58d151a01b5e54d7b4210d531f | [
"MIT"
] | null | null | null | print("Hello, World!")
x = 10
print(x)
if x == 10:
print("x is 10")
if 1:
print("x")
y = 20
z = 30
| 10.666667 | 23 | 0.421875 |
a70251cafcab2f534be9772b54c180888f5e348b | 52,752 | py | Python | qa/rpc-tests/p2p-fullblocktest.py | devfans/liquid | dd1d4eb4ad07dea869de3401f42a0f62e552fdb9 | [
"MIT"
] | 83 | 2018-11-06T20:49:33.000Z | 2021-11-17T23:46:59.000Z | qa/rpc-tests/p2p-fullblocktest.py | devfans/liquid | dd1d4eb4ad07dea869de3401f42a0f62e552fdb9 | [
"MIT"
] | 160 | 2018-04-20T16:45:33.000Z | 2021-02-20T15:17:10.000Z | qa/rpc-tests/p2p-fullblocktest.py | devfans/liquid | dd1d4eb4ad07dea869de3401f42a0f62e552fdb9 | [
"MIT"
] | 40 | 2018-11-07T00:12:10.000Z | 2022-01-31T03:10:15.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from ... | 40.829721 | 131 | 0.544719 |
08a29c7e51c9d3bf0d552d7437a819dc17664b67 | 1,450 | py | Python | packages/python/yap_kernel/yap_ipython/utils/tests/test_openpy.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 90 | 2015-03-09T01:24:15.000Z | 2022-02-24T13:56:25.000Z | packages/python/yap_kernel/yap_ipython/utils/tests/test_openpy.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 52 | 2016-02-14T08:59:37.000Z | 2022-03-14T16:39:35.000Z | packages/python/yap_kernel/yap_ipython/utils/tests/test_openpy.py | ryandesign/yap | 9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 27 | 2015-11-19T02:45:49.000Z | 2021-11-25T19:47:58.000Z | import io
import os.path
import nose.tools as nt
from yap_ipython.utils import openpy
mydir = os.path.dirname(__file__)
nonascii_path = os.path.join(mydir, '../../core/tests/nonascii.py')
def test_detect_encoding():
f = open(nonascii_path, 'rb')
enc, lines = openpy.detect_encoding(f.readline)
nt.assert_e... | 37.179487 | 100 | 0.730345 |
16532717a4fba5869464edc924880f8003463597 | 4,270 | py | Python | python/lsa_loss_fig_2.py | xandaschofield/text-duplication | 0942d7b337475146cefdae63b25feb73bbab56da | [
"BSD-2-Clause"
] | null | null | null | python/lsa_loss_fig_2.py | xandaschofield/text-duplication | 0942d7b337475146cefdae63b25feb73bbab56da | [
"BSD-2-Clause"
] | null | null | null | python/lsa_loss_fig_2.py | xandaschofield/text-duplication | 0942d7b337475146cefdae63b25feb73bbab56da | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Laure Thompson
import os
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import numpy as np
from pandas import DataFrame
import seaborn as sns
import lsa
from plot_lsa_loss_exact_single import gather_loss_for_seq_file
from plot_help... | 30.5 | 84 | 0.577049 |
930f66240fd3640eb52b28cd4b83cae5e2225e08 | 669 | py | Python | python_scripts/keychain/managedconfiguration.py | slango20/iphone-dataprotection | 424317205f2077dbb8d9712286ae4c181fb05075 | [
"Xnet",
"X11"
] | 19 | 2019-04-27T15:09:22.000Z | 2022-03-27T14:06:15.000Z | python_scripts/keychain/managedconfiguration.py | slango20/iphone-dataprotection | 424317205f2077dbb8d9712286ae4c181fb05075 | [
"Xnet",
"X11"
] | null | null | null | python_scripts/keychain/managedconfiguration.py | slango20/iphone-dataprotection | 424317205f2077dbb8d9712286ae4c181fb05075 | [
"Xnet",
"X11"
] | 4 | 2020-11-10T19:23:01.000Z | 2022-02-25T02:10:19.000Z | """
0
1:MCSHA256DigestWithSalt
2:SecKeyFromPassphraseDataHMACSHA1
"""
from crypto.PBKDF2 import PBKDF2
import plistlib
import hashlib
SALT1 = "F92F024CA2CB9754".decode("hex")
hashMethods={
1: (lambda p,salt:hashlib.sha256(SALT1 + p)),
2: (lambda p,salt:PBKDF2(p, salt, iterations=1000).read(20))
... | 23.892857 | 69 | 0.587444 |
b1961799819f72ed1ffa6fb53dfa7fcccfeec238 | 1,478 | py | Python | handlers/show_countdown.py | DurbeKK/countdown-tg-bot | ed7152d642ed746ddfbde36fd126a8d958fd8127 | [
"MIT"
] | 2 | 2022-02-02T12:48:15.000Z | 2022-03-03T18:55:15.000Z | handlers/show_countdown.py | DurbeKK/countdown-tg-bot | ed7152d642ed746ddfbde36fd126a8d958fd8127 | [
"MIT"
] | null | null | null | handlers/show_countdown.py | DurbeKK/countdown-tg-bot | ed7152d642ed746ddfbde36fd126a8d958fd8127 | [
"MIT"
] | null | null | null | """Show countdown operation is handled here."""
from utils.calculate_diff import calculate_diff
from utils.send_message import send_message
async def send_countdown_details(
user_id: int, cd_name: str, date_time: str, cd_format: int, scheduled=True
):
"""Send how much time is left till the countdown is up.
... | 28.423077 | 78 | 0.630582 |
e13cf4d32bf8b67aa92cba717803d767fa56fdec | 11,301 | py | Python | k2/python/tests/intersect_dense_pruned_test.py | Jarvan-Wang/k2 | 7f164ecb804d15006fd30e8564d80e0fa212f011 | [
"Apache-2.0"
] | null | null | null | k2/python/tests/intersect_dense_pruned_test.py | Jarvan-Wang/k2 | 7f164ecb804d15006fd30e8564d80e0fa212f011 | [
"Apache-2.0"
] | null | null | null | k2/python/tests/intersect_dense_pruned_test.py | Jarvan-Wang/k2 | 7f164ecb804d15006fd30e8564d80e0fa212f011 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2020 Mobvoi Inc. (authors: Fangjun Kuang)
#
# See ../../../LICENSE for clarification regarding multiple authors
# To run this single test, use
#
# ctest --verbose -R intersect_dense_pruned_test_py
import unittest
import k2
import torch
class TestIntersectDensePrun... | 41.094545 | 80 | 0.449341 |
0d9b1b63cea3cbc53dbdccd16287aeb0a72ca421 | 4,552 | py | Python | datasets/ppisp/deepPISP.py | avivko/graphein | 0a2d5e39787cf002c06b03615d9dd3fe62e0171d | [
"MIT"
] | 342 | 2020-03-11T18:29:46.000Z | 2022-03-31T14:30:16.000Z | datasets/ppisp/deepPISP.py | avivko/graphein | 0a2d5e39787cf002c06b03615d9dd3fe62e0171d | [
"MIT"
] | 126 | 2020-05-22T19:54:23.000Z | 2022-03-31T17:16:49.000Z | datasets/ppisp/deepPISP.py | avivko/graphein | 0a2d5e39787cf002c06b03615d9dd3fe62e0171d | [
"MIT"
] | 51 | 2020-04-25T06:45:25.000Z | 2022-03-09T15:22:34.000Z | import pickle
import pandas as pd
import torch
from Bio.PDB import *
from torch_geometric.data import Data
from tqdm import tqdm
from graphein.construct_graphs import ProteinGraph
# Get DeepPPISP Data
with open("all_dset_list.pkl", "rb") as f:
index = pickle.load(f)
with open("dset186_label.pkl", "rb") as f:
... | 26.776471 | 114 | 0.644552 |
5923df1c4b78b9a56c526cc8ed9d780421653efe | 12,842 | py | Python | explainers/sorting_demonstrations.py | a-v-e-s/LeetCode | 9101df0fbac61090ea9ed14cbda34dd4c03aa2d6 | [
"Unlicense"
] | null | null | null | explainers/sorting_demonstrations.py | a-v-e-s/LeetCode | 9101df0fbac61090ea9ed14cbda34dd4c03aa2d6 | [
"Unlicense"
] | null | null | null | explainers/sorting_demonstrations.py | a-v-e-s/LeetCode | 9101df0fbac61090ea9ed14cbda34dd4c03aa2d6 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""
recommended use:
$ ./sorting_demonstrations.py | less
or:
$ python sorting_demonstrations.py | less
"""
import random
import timeit
LENGTH = 20
rarr = lambda length=LENGTH: [random.randint(1, length*3) for _ in range(length)]
def bubble_sort(array, printing=True):
n = len(array)
... | 37.994083 | 111 | 0.577324 |
eca1b7262e862a404dbf00c974be495295d6abc5 | 8,149 | py | Python | userbot/modules/afk.py | MigH3AliEn/MigH3UB | 444293d712b991fd5b5a044b6c1ef6b2ba8487c6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/afk.py | MigH3AliEn/MigH3UB | 444293d712b991fd5b5a044b6c1ef6b2ba8487c6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/afk.py | MigH3AliEn/MigH3UB | 444293d712b991fd5b5a044b6c1ef6b2ba8487c6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module which contains afk-related commands """
from random import choice, randint
from asyncio import slee... | 38.990431 | 102 | 0.58682 |
bebdf198fb2aa9339ed022f111949d4a7cb36b80 | 97 | py | Python | enthought/undo/i_undo_manager.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/undo/i_undo_manager.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/undo/i_undo_manager.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from apptools.undo.i_undo_manager import *
| 24.25 | 42 | 0.845361 |
3ef8b4c46533fceb33154be7659f8e478595042d | 62 | py | Python | sdk/lusid_workflows/utilities/__init__.py | finbourne/workflows-sdk-generated-preview | 41201c402e8d006740d278339cb80283000e4ce6 | [
"MIT"
] | null | null | null | sdk/lusid_workflows/utilities/__init__.py | finbourne/workflows-sdk-generated-preview | 41201c402e8d006740d278339cb80283000e4ce6 | [
"MIT"
] | null | null | null | sdk/lusid_workflows/utilities/__init__.py | finbourne/workflows-sdk-generated-preview | 41201c402e8d006740d278339cb80283000e4ce6 | [
"MIT"
] | null | null | null | from lusid_workflows.utilities.config_keys import ConfigKeys
| 20.666667 | 60 | 0.887097 |
646e540396565c2cb0393fb1a76357c3f0ef2a91 | 3,251 | py | Python | ledfx/config.py | VladlenKaveev/LedFx | 56401b3df7c0770471c290ece8d9da8d98698084 | [
"MIT"
] | 4 | 2020-09-02T17:40:56.000Z | 2021-03-01T08:39:28.000Z | ledfx/config.py | VladlenKaveev/LedFx | 56401b3df7c0770471c290ece8d9da8d98698084 | [
"MIT"
] | null | null | null | ledfx/config.py | VladlenKaveev/LedFx | 56401b3df7c0770471c290ece8d9da8d98698084 | [
"MIT"
] | null | null | null | import voluptuous as vol
import logging
import yaml
import sys
import os
_LOGGER = logging.getLogger(__name__)
CONFIG_DIRECTORY = '.ledfx'
CONFIG_FILE_NAME = 'config.yaml'
CORE_CONFIG_SCHEMA = vol.Schema({
vol.Optional('host', default = '127.0.0.1'): str,
vol.Optional('port', default = 8888): int,
vol.Op... | 35.336957 | 92 | 0.690249 |
9fa0feb4bedad1556a7bf3e75983bac6e6d21c0d | 1,233 | py | Python | test/entry_context_Test.py | juanmiguelRuaDev/door-states-app | cfeb784bfddec69bbd870eb7928457637be7a743 | [
"MIT"
] | null | null | null | test/entry_context_Test.py | juanmiguelRuaDev/door-states-app | cfeb784bfddec69bbd870eb7928457637be7a743 | [
"MIT"
] | null | null | null | test/entry_context_Test.py | juanmiguelRuaDev/door-states-app | cfeb784bfddec69bbd870eb7928457637be7a743 | [
"MIT"
] | null | null | null | import os
import unittest
from src.core.contexts import EntryContext
from src.core.states.entry import EntryInitialState, EntryEmergencyState, EntryDoorOpenedState
from src.utils.common import Config
class EntryContextTestCase(unittest.TestCase):
def setUp(self):
base_dir = os.path.dirname(os.path.realp... | 41.1 | 94 | 0.755069 |
6d375d8f9fd511ee3b1c40367cffa4d46c06ea7e | 3,328 | py | Python | 10.1-Station/Station.py | Kehvarl/AdventOfCode2019 | f72cfeefdfbde365bc9a5b722d5875d556379cf2 | [
"MIT"
] | 1 | 2020-09-27T23:02:46.000Z | 2020-09-27T23:02:46.000Z | 10.1-Station/Station.py | Kehvarl/AdventOfCode2019 | f72cfeefdfbde365bc9a5b722d5875d556379cf2 | [
"MIT"
] | null | null | null | 10.1-Station/Station.py | Kehvarl/AdventOfCode2019 | f72cfeefdfbde365bc9a5b722d5875d556379cf2 | [
"MIT"
] | 1 | 2019-12-09T17:10:48.000Z | 2019-12-09T17:10:48.000Z | from math import atan2
import math
test = """.#......##.#..#.......#####...#..
...#.....##......###....#.##.....
..#...#....#....#............###.
.....#......#.##......#.#..###.#.
#.#..........##.#.#...#.##.#.#.#.
..#.##.#...#.......#..##.......##
..#....#.....#..##.#..####.#.....
#.............#..#.........#.#...
..... | 22.951724 | 62 | 0.372596 |
23c4d615b865d68d42c12c66665ce14d8fe469b3 | 1,790 | py | Python | dataclasses_avroschema/types.py | rh-marketingops/dataclasses-avroschema | 13ec2cb14fb7cc743bae9b3e66fdeed105f60ec6 | [
"MIT"
] | null | null | null | dataclasses_avroschema/types.py | rh-marketingops/dataclasses-avroschema | 13ec2cb14fb7cc743bae9b3e66fdeed105f60ec6 | [
"MIT"
] | null | null | null | dataclasses_avroschema/types.py | rh-marketingops/dataclasses-avroschema | 13ec2cb14fb7cc743bae9b3e66fdeed105f60ec6 | [
"MIT"
] | null | null | null | import dataclasses
import typing
T = typing.TypeVar("T")
class MissingSentinel(typing.Generic[T]):
"""
Class to detect when a field is not initialized
"""
...
@dataclasses.dataclass
class Fixed(typing.Generic[T]):
"""
Represents an Avro Fixed type
size (int): Specifying the number of ... | 24.189189 | 72 | 0.681564 |
6ed0a3ecd23e4dafa1522e658239d2b118cfb6df | 5,145 | py | Python | JTVAE/fast_jtnn/jtmpn.py | kevingreenman/uncertainty_guided_optimization | b50b0fba603938124182b3f9912d22fad025cd68 | [
"MIT"
] | 11 | 2021-11-18T23:41:00.000Z | 2022-02-21T22:11:06.000Z | JTVAE/fast_jtnn/jtmpn.py | Pa-Sky/uncertainty_guided_optimization | 698d814ab01d54573875dfc1bcae451786ba8d2a | [
"MIT"
] | null | null | null | JTVAE/fast_jtnn/jtmpn.py | Pa-Sky/uncertainty_guided_optimization | 698d814ab01d54573875dfc1bcae451786ba8d2a | [
"MIT"
] | 4 | 2021-11-19T00:09:35.000Z | 2021-12-21T16:40:52.000Z | import rdkit.Chem as Chem
import torch
import torch.nn as nn
import torch.nn.functional as F
from JTVAE.fast_jtnn.nnutils import create_var, index_select_ND
from JTVAE.fast_jtnn.chemutils import get_mol
ELEM_LIST = ['C', 'N', 'O', 'S', 'F', 'Si', 'P', 'Cl', 'Br', 'Mg', 'Na', 'Ca', 'Fe', 'Al', 'I', 'B', 'K', 'Se', 'Z... | 37.014388 | 184 | 0.568124 |
be5741f71cc60845cf5ba858d08bed8c5bb6976e | 1,057 | py | Python | gateaux/fields/binary.py | meeb/gateaux | d7cc904c7bc91c2c39aa3b1e16cd28ac1ed0b389 | [
"MIT"
] | 3 | 2020-07-12T16:22:02.000Z | 2020-12-09T19:50:16.000Z | gateaux/fields/binary.py | meeb/gateaux | d7cc904c7bc91c2c39aa3b1e16cd28ac1ed0b389 | [
"MIT"
] | null | null | null | gateaux/fields/binary.py | meeb/gateaux | d7cc904c7bc91c2c39aa3b1e16cd28ac1ed0b389 | [
"MIT"
] | null | null | null | from typing import Type, Union
from .base import BaseField
from ..errors import ValidationError
class BinaryField(BaseField):
'''
A BinaryField() takes and returns binary data as bytes. It performs no
conversion and is the most basic field type. Storage in FoundationDB is also
as bytes.
... | 31.088235 | 84 | 0.600757 |
8ed15d1d5dd3416ef0d138702705457f5bc69d92 | 764 | py | Python | commons/common/filters.py | kalumewakitsao/commons | 2d5e8580090e8a04d01a15f9e83c4785cc9eb661 | [
"MIT"
] | null | null | null | commons/common/filters.py | kalumewakitsao/commons | 2d5e8580090e8a04d01a15f9e83c4785cc9eb661 | [
"MIT"
] | null | null | null | commons/common/filters.py | kalumewakitsao/commons | 2d5e8580090e8a04d01a15f9e83c4785cc9eb661 | [
"MIT"
] | null | null | null | from django_filters.rest_framework import FilterSet
from commons.common import models
class CountyFilter(FilterSet):
class Meta:
model = models.County
fields = "__all__"
class SubCountyFilter(FilterSet):
class Meta:
model = models.SubCounty
fields = "__all__"
class Const... | 16.977778 | 51 | 0.657068 |
6a632d5a4129b9186e8cb3de37354bcffb0234f9 | 18,728 | py | Python | zappa/utilities.py | johnarnfield/Zappa | f58270afd33e23c1fd8c736c1f56bb5b91648b28 | [
"MIT"
] | null | null | null | zappa/utilities.py | johnarnfield/Zappa | f58270afd33e23c1fd8c736c1f56bb5b91648b28 | [
"MIT"
] | null | null | null | zappa/utilities.py | johnarnfield/Zappa | f58270afd33e23c1fd8c736c1f56bb5b91648b28 | [
"MIT"
] | null | null | null | import botocore
import calendar
import datetime
import durationpy
import fnmatch
import io
import json
import logging
import os
import re
import shutil
import stat
import sys
from past.builtins import basestring
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
LOG = lo... | 32.513889 | 143 | 0.60236 |
880a950ed0fd4f0c642e8c8c60408627bd2c8a9c | 3,950 | py | Python | tools/test_sqlite_tags.py | mfbehrens99/every_door | d84abd34db21337152b381c4ed5f36e4c336fcab | [
"ISC"
] | null | null | null | tools/test_sqlite_tags.py | mfbehrens99/every_door | d84abd34db21337152b381c4ed5f36e4c336fcab | [
"ISC"
] | null | null | null | tools/test_sqlite_tags.py | mfbehrens99/every_door | d84abd34db21337152b381c4ed5f36e4c336fcab | [
"ISC"
] | null | null | null | #!/usr/bin/env python3
import sys
import sqlite3
sql = """
with langs (lang, lscore) as (
values ('ru', 2), ('en', 1)
)
,tags (skey, svalue) as (
values
('building', 'yes'),
('tourism', 'information'),
('information', 'office'),
('name', 'Инфопункт'),
('opening_hours', '24/7')
)
,matches as (
select pr... | 26.15894 | 91 | 0.671392 |
9d0e2c1d44fd78e8195cb6b1f7aa514edefa85ad | 404 | py | Python | tradgram/caseFiles/migrations/0009_casefile_expiredate.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | tradgram/caseFiles/migrations/0009_casefile_expiredate.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | 4 | 2020-06-05T20:21:46.000Z | 2021-09-08T00:57:42.000Z | tradgram/caseFiles/migrations/0009_casefile_expiredate.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | # Generated by Django 2.0.8 on 2019-03-23 04:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('caseFiles', '0008_casefile_isreportexist'),
]
operations = [
migrations.AddField(
model_name='casefile',
name='expir... | 21.263158 | 58 | 0.608911 |
48d0f24e5dc231ab01385bdbecc18a93fea8002c | 3,022 | py | Python | assets/scripts/utils/feature_extract.py | ga642381/robust-vc | 90c5c51007db4544885e903d755fb95fadd1fb71 | [
"MIT"
] | 12 | 2022-01-12T12:38:22.000Z | 2022-02-14T02:25:48.000Z | assets/scripts/utils/feature_extract.py | ga642381/robust-vc | 90c5c51007db4544885e903d755fb95fadd1fb71 | [
"MIT"
] | null | null | null | assets/scripts/utils/feature_extract.py | ga642381/robust-vc | 90c5c51007db4544885e903d755fb95fadd1fb71 | [
"MIT"
] | null | null | null | from functools import partial
from multiprocessing import Pool, cpu_count
from typing import List
import torch
from fairseq.checkpoint_utils import load_model_ensemble
from torch.nn.utils.rnn import pad_sequence
from .utils import log_mel_spectrogram
def load_pretrained_wav2vec(ckpt_path: str):
"""Load pretrain... | 30.525253 | 101 | 0.534745 |
14394368d3c837c9a72f2f8d3da9b1c20d8be456 | 3,012 | py | Python | src/util_functions.py | AviBuckman/Vulnerability-Checker | 105c49fb762ad2d75c050b1a7eb061375c3405c0 | [
"BSD-3-Clause"
] | null | null | null | src/util_functions.py | AviBuckman/Vulnerability-Checker | 105c49fb762ad2d75c050b1a7eb061375c3405c0 | [
"BSD-3-Clause"
] | null | null | null | src/util_functions.py | AviBuckman/Vulnerability-Checker | 105c49fb762ad2d75c050b1a7eb061375c3405c0 | [
"BSD-3-Clause"
] | null | null | null | import subprocess
from csv import reader
import re
MD5 = "md5"
SHA1 = "sha1"
SHA256 = "sha256"
B2 = "b2"
def is_debian():
result = subprocess.run("whereis dpkg", shell=True,
stdout=subprocess.PIPE).stdout.decode('utf-8')
return result.__contains__('/')
def get_file_type(path):
... | 28.149533 | 99 | 0.628154 |
0e93ef65d34fcaef5ca97be73c9c211821357294 | 10,940 | py | Python | custom/world_vision/sqldata/main_sqldata.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | null | null | null | custom/world_vision/sqldata/main_sqldata.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | null | null | null | custom/world_vision/sqldata/main_sqldata.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | null | null | null | from sqlagg import CountUniqueColumn
from sqlagg.filters import LTE, AND, EQ, OR, GTE, NOTEQ
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.reports.sqlreport import DatabaseColumn
from custom.world_vision.sqldata import BaseSqlData
class AnteNatalCareServiceOverview(Bas... | 52.850242 | 136 | 0.548446 |
97475cefaf7f101311741f92bcb4b7d1a0804838 | 28,325 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_protection_plans_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_protection_plans_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_ddos_protection_plans_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.668385 | 207 | 0.665666 |
36b3588fe7ab9c6775767e79ae58fe08d6c6c11f | 821 | py | Python | setup.py | majorpb/pdf2keynote | 948a2891920993ff668e32883f9b98301f4fc1f9 | [
"MIT"
] | null | null | null | setup.py | majorpb/pdf2keynote | 948a2891920993ff668e32883f9b98301f4fc1f9 | [
"MIT"
] | null | null | null | setup.py | majorpb/pdf2keynote | 948a2891920993ff668e32883f9b98301f4fc1f9 | [
"MIT"
] | null | null | null | """
inspired from
https://python-packaging.readthedocs.io/en/latest/
we use find_packages because of this:
https://stackoverflow.com/questions/43253701/python-packaging-subdirectories-not-installed
"""
from setuptools import setup, find_packages
setup(name='pdf2keynote', # pyton module name
version='1.0',
... | 28.310345 | 90 | 0.656516 |
9b73559a3e2704203595644a267829d44bd1e3e1 | 15,805 | py | Python | graph_objs/layout/_title.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/layout/_title.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/layout/_title.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Title(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.title"
_valid_props = {
"font",
"pad",
... | 32.995825 | 84 | 0.537994 |
f29b814b90024f1cf0d2bb8c2b94c21895661c4a | 1,992 | py | Python | duoPersist.py | susemm/books | 80e96dd0ef7309707b37b036c991d4b11a9bed0a | [
"Apache-2.0"
] | null | null | null | duoPersist.py | susemm/books | 80e96dd0ef7309707b37b036c991d4b11a9bed0a | [
"Apache-2.0"
] | null | null | null | duoPersist.py | susemm/books | 80e96dd0ef7309707b37b036c991d4b11a9bed0a | [
"Apache-2.0"
] | null | null | null | __author__ = 'vin@misday.com'
from pyvin.core import SqliteHelp
class Persist(SqliteHelp):
DB_NAME = 'data.db'
DB_VER = 1
CREATE_BOOK_TBL = '''
CREATE TABLE IF NOT EXISTS book (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
bid TEXT NOT NULL,
title TEXT NOT NULL,
... | 30.646154 | 142 | 0.534137 |
6d1d1c37bd64b4716c904dd3b3a4139aa6adae59 | 792 | py | Python | Examples/AdvancedUsage/Search/SearchDigital.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python-samples | ff2de5acfc00421b2ccf3ae5ddb199261f2f5449 | [
"MIT"
] | null | null | null | Examples/AdvancedUsage/Search/SearchDigital.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python-samples | ff2de5acfc00421b2ccf3ae5ddb199261f2f5449 | [
"MIT"
] | null | null | null | Examples/AdvancedUsage/Search/SearchDigital.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python-samples | ff2de5acfc00421b2ccf3ae5ddb199261f2f5449 | [
"MIT"
] | 2 | 2018-12-20T11:12:08.000Z | 2019-07-08T13:01:22.000Z | # Import modules
from groupdocs_signature_cloud import *
import groupdocs_signature_cloud
from Common import Common
class SearchDigital:
@classmethod
def Run(cls):
# Create instance of the API
api = groupdocs_signature_cloud.SignApi.from_config(Common.GetConfig())
fileInfo... | 29.333333 | 79 | 0.664141 |
9e358eb853d93956991d69c98f2fd26a67a31edb | 2,564 | py | Python | espn_api/hockey/team.py | austinegri/espn-api | 1dea3406627fdb8c72893ca9d5553b587081e9c4 | [
"MIT"
] | 1 | 2021-05-15T07:00:52.000Z | 2021-05-15T07:00:52.000Z | espn_api/hockey/team.py | austinegri/espn-api | 1dea3406627fdb8c72893ca9d5553b587081e9c4 | [
"MIT"
] | null | null | null | espn_api/hockey/team.py | austinegri/espn-api | 1dea3406627fdb8c72893ca9d5553b587081e9c4 | [
"MIT"
] | null | null | null | import pandas as pd
from .constant import STATS_MAP
from .matchup import Matchup
from .player import Player
class Team(object):
'''Teams are part of the league'''
def __init__(self, data, member, roster, schedule, year):
self.team_id = data['id']
self.team_abbrev = data['abbrev']... | 35.123288 | 105 | 0.539782 |
c2c2f11332f9a89bb827812ff8083afc61783cbf | 1,284 | py | Python | src/hooks.py | wikimedia/labs-tools-SuchABot | 62c8fcd6764db7d31da28f01f2a71108ce5b2168 | [
"WTFPL"
] | 2 | 2015-04-30T00:32:58.000Z | 2015-05-06T20:45:28.000Z | src/hooks.py | wikimedia/labs-tools-SuchABot | 62c8fcd6764db7d31da28f01f2a71108ce5b2168 | [
"WTFPL"
] | null | null | null | src/hooks.py | wikimedia/labs-tools-SuchABot | 62c8fcd6764db7d31da28f01f2a71108ce5b2168 | [
"WTFPL"
] | null | null | null | import argparse
import getpass
import sys
import github
gh = None
def login(username, password):
global gh
gh = github.GitHub(username=username, password=password)
def add_hook(owner, repo, hook, url):
try:
gh.repos(owner, repo).hooks().post(name='web',
active=True,
... | 27.913043 | 99 | 0.60514 |
c0c9dadbc0f8fdf685d8b3ccb2ff8d4e7f2c9f29 | 1,130 | py | Python | airflow/hooks/slack_hook.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | airflow/hooks/slack_hook.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 153 | 2021-10-15T05:23:46.000Z | 2022-02-23T06:07:10.000Z | airflow/hooks/slack_hook.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 37.666667 | 83 | 0.765487 |
f93c349f5a189da62c2695318a8fbe5e4e682702 | 525 | py | Python | test/helper/thread/is_none_test.py | jakob-bagterp/timer_for_python | 351d0fa1336cfb001f7813225d46383f82f34a1e | [
"MIT"
] | 1 | 2021-12-06T18:04:26.000Z | 2021-12-06T18:04:26.000Z | test/helper/thread/is_none_test.py | jakob-bagterp/timer_for_python | 351d0fa1336cfb001f7813225d46383f82f34a1e | [
"MIT"
] | null | null | null | test/helper/thread/is_none_test.py | jakob-bagterp/timer_for_python | 351d0fa1336cfb001f7813225d46383f82f34a1e | [
"MIT"
] | null | null | null | import timer.helper.thread as thread
class TestThreadIsNone():
def test_real_none(self) -> None:
assert thread.is_none(None) is True
def test_text_none_uppercase(self) -> None:
assert thread.is_none("NONE") is True
def test_text_none_lowercase(self) -> None:
assert thread.... | 29.166667 | 51 | 0.67619 |
1683ff51ae4db5a2f915f33e203fbd81dfa6a65b | 810 | py | Python | manage.py | alokchoudhary899/realtimeChatApp | 008bd220e6f480f936efb8e7d2b806a64af92a86 | [
"MIT"
] | null | null | null | manage.py | alokchoudhary899/realtimeChatApp | 008bd220e6f480f936efb8e7d2b806a64af92a86 | [
"MIT"
] | null | null | null | manage.py | alokchoudhary899/realtimeChatApp | 008bd220e6f480f936efb8e7d2b806a64af92a86 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "realtimeChat.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that... | 35.217391 | 77 | 0.644444 |
24cf6edecb3269e56b5c7da9f83f5bac348e067a | 483 | py | Python | crawler/project/jingdong/jingdong/items.py | kangyijie5473/Distributed_crawler | 233f77748b039d342adb26324737b2d6efff33ad | [
"MIT"
] | 3 | 2018-04-30T07:53:01.000Z | 2021-12-09T11:28:59.000Z | crawler/project/jingdong/jingdong/items.py | kangyijie5473/Distributed_crawler | 233f77748b039d342adb26324737b2d6efff33ad | [
"MIT"
] | null | null | null | crawler/project/jingdong/jingdong/items.py | kangyijie5473/Distributed_crawler | 233f77748b039d342adb26324737b2d6efff33ad | [
"MIT"
] | 4 | 2017-11-22T06:05:39.000Z | 2021-12-09T11:29:01.000Z | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class JingdongItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
title = scrapy.Field()
link = scra... | 23 | 51 | 0.664596 |
588a4732819af38ec41d02a0d45c7635c56c1c42 | 2,606 | py | Python | exporter/applications/forms/edit.py | django-doctor/lite-frontend | 330ff9575fd22d7c4c42698ac2d653244e6180d6 | [
"MIT"
] | 1 | 2021-10-16T16:36:58.000Z | 2021-10-16T16:36:58.000Z | exporter/applications/forms/edit.py | django-doctor/lite-frontend | 330ff9575fd22d7c4c42698ac2d653244e6180d6 | [
"MIT"
] | 45 | 2020-08-11T14:37:46.000Z | 2022-03-29T17:03:02.000Z | exporter/applications/forms/edit.py | django-doctor/lite-frontend | 330ff9575fd22d7c4c42698ac2d653244e6180d6 | [
"MIT"
] | 3 | 2021-02-01T06:26:19.000Z | 2022-02-21T23:02:46.000Z | from exporter.applications.components import back_to_task_list
from lite_content.lite_exporter_frontend import applications, generic, strings
from lite_content.lite_exporter_frontend.applications import ExportLicenceQuestions
from lite_forms.components import Form, TextInput, Option, RadioButtons
from lite_forms.helper... | 43.433333 | 135 | 0.649655 |
55d5d40e741cce09078280320fc68b0623f61849 | 1,264 | py | Python | test/test_fitting.py | stur86/muspinsim | 17c035475aa3fd4278f8c270c9a40cc214631b42 | [
"MIT"
] | 2 | 2021-02-23T12:34:42.000Z | 2021-04-28T09:33:33.000Z | test/test_fitting.py | stur86/muspinsim | 17c035475aa3fd4278f8c270c9a40cc214631b42 | [
"MIT"
] | 1 | 2021-02-02T14:27:43.000Z | 2021-02-08T17:32:55.000Z | test/test_fitting.py | stur86/muspinsim | 17c035475aa3fd4278f8c270c9a40cc214631b42 | [
"MIT"
] | 1 | 2021-04-26T14:03:50.000Z | 2021-04-26T14:03:50.000Z | import unittest
import numpy as np
from io import StringIO
from muspinsim.input import MuSpinInput
from muspinsim.fitting import FittingRunner
class TestFitting(unittest.TestCase):
def test_fitset(self):
s1 = StringIO(
"""
fitting_variables
x 0.0
y 1.0 0 2.0
fitting_data
0 0.... | 20.387097 | 66 | 0.536392 |
4127d690f74669640a602b186d98dc24ed83f0c5 | 11,687 | py | Python | lib/datasets/transforms.py | dongnana777/Bridging-Non-Co-occurrence | edde2719ee69bfb72b5ff771c95fd13d4179f26a | [
"MIT"
] | 5 | 2021-11-01T02:35:14.000Z | 2022-03-16T06:36:30.000Z | lib/datasets/transforms.py | dongnana777/Bridging-Non-Co-occurrence | edde2719ee69bfb72b5ff771c95fd13d4179f26a | [
"MIT"
] | 2 | 2021-11-22T02:41:38.000Z | 2022-03-16T06:25:53.000Z | lib/datasets/transforms.py | dongnana777/Bridging-Non-Co-occurrence | edde2719ee69bfb72b5ff771c95fd13d4179f26a | [
"MIT"
] | 1 | 2021-12-10T03:09:14.000Z | 2021-12-10T03:09:14.000Z | import torch
from torchvision import transforms
import cv2
import numpy as np
import types
from numpy import random
def intersect(box_a, box_b):
max_xy = np.minimum(box_a[:, 2:], box_b[2:])
min_xy = np.maximum(box_a[:, :2], box_b[:2])
inter = np.clip((max_xy - min_xy), a_min=0, a_max=np.inf)
return in... | 32.019178 | 91 | 0.550355 |
9b96d86557ec8e938091089baa96fc7e8f9f87bd | 1,553 | py | Python | Python/super-palindromes.py | alanshenpku/LeetCode | bc1b5ac498e6e1caba73f3a99906229230a0bf22 | [
"MIT"
] | 9 | 2019-06-30T07:15:18.000Z | 2022-02-10T20:13:40.000Z | Python/super-palindromes.py | wukoo/LeetCode-2 | a59e601a514aaa889812e9d176f59fa41c26e7b5 | [
"MIT"
] | null | null | null | Python/super-palindromes.py | wukoo/LeetCode-2 | a59e601a514aaa889812e9d176f59fa41c26e7b5 | [
"MIT"
] | 9 | 2019-01-16T22:16:49.000Z | 2022-02-06T17:33:41.000Z | # Time: O(n^0.25 * logn)
# Space: O(logn)
# Let's say a positive integer is a superpalindrome
# if it is a palindrome, and it is also the square of a palindrome.
#
# Now, given two positive integers L and R (represented as strings),
# return the number of superpalindromes in the inclusive range [L, R].
#
# Example 1:... | 25.883333 | 70 | 0.472634 |
97f473c95fdf02c559e359e21be7242ab64c5ba5 | 395,137 | py | Python | src/plugins/nat/test/test_nat.py | hardboydu/vpp | e7df8cbb6d83533d0204bfbc1a0fe341f07d9741 | [
"Apache-2.0"
] | null | null | null | src/plugins/nat/test/test_nat.py | hardboydu/vpp | e7df8cbb6d83533d0204bfbc1a0fe341f07d9741 | [
"Apache-2.0"
] | null | null | null | src/plugins/nat/test/test_nat.py | hardboydu/vpp | e7df8cbb6d83533d0204bfbc1a0fe341f07d9741 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import ipaddress
import random
import socket
import struct
import unittest
from io import BytesIO
from time import sleep
import scapy.compat
from framework import VppTestCase, VppTestRunner, running_extended_tests
from ipfix import IPFIX, Set, Template, Data, IPFIXDecoder
from scapy.all import ... | 40.993568 | 79 | 0.579723 |
9000f457c10e075ae5634f0241be53ca0021d186 | 104 | py | Python | output/models/ms_data/regex/regex_test_261_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/regex/regex_test_261_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/regex/regex_test_261_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.regex.regex_test_261_xsd.regex_test_261 import Doc
__all__ = [
"Doc",
]
| 17.333333 | 77 | 0.759615 |
52daa56bf404121c666dec2ebdc9b082186f03fb | 2,533 | py | Python | api/server/swagger_server/models/api_catalog_upload_item.py | krishnakumar27/mlx | dce67d58dffa24ca7a6a4d6b5fd8d4eb94e35215 | [
"Apache-2.0"
] | 98 | 2021-05-03T23:27:53.000Z | 2022-03-13T02:29:12.000Z | api/server/swagger_server/models/api_catalog_upload_item.py | krishnakumar27/mlx | dce67d58dffa24ca7a6a4d6b5fd8d4eb94e35215 | [
"Apache-2.0"
] | 296 | 2021-05-03T22:44:26.000Z | 2022-03-31T11:50:16.000Z | api/server/swagger_server/models/api_catalog_upload_item.py | krishnakumar27/mlx | dce67d58dffa24ca7a6a4d6b5fd8d4eb94e35215 | [
"Apache-2.0"
] | 38 | 2021-05-03T22:52:59.000Z | 2022-03-31T03:58:34.000Z | # Copyright 2021 The MLX Contributors
#
# SPDX-License-Identifier: Apache-2.0
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
clas... | 25.846939 | 89 | 0.600869 |
6ad89554a339eb385b6be1269fe34707f27f6ad8 | 602 | py | Python | python/hackerrank/pilingup/main.py | imjoseangel/sandbox | bc4ff74981faf91eb1a1f777d01fcfd13d6f5147 | [
"MIT"
] | null | null | null | python/hackerrank/pilingup/main.py | imjoseangel/sandbox | bc4ff74981faf91eb1a1f777d01fcfd13d6f5147 | [
"MIT"
] | null | null | null | python/hackerrank/pilingup/main.py | imjoseangel/sandbox | bc4ff74981faf91eb1a1f777d01fcfd13d6f5147 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from collections import deque
def main():
for _ in range(int(input())):
_, a = int(input()), deque(map(int, input().split()))
for cube in ... | 19.419355 | 66 | 0.473422 |
5f0cfb6996a4accdac8c6a4b188a3b058cdb0325 | 3,159 | py | Python | datascienceUI.py | sarthakpurohit/Land-Use-Classification | 998d6faae2ae67cfcf2f6c5098d4e918b99ae998 | [
"MIT"
] | null | null | null | datascienceUI.py | sarthakpurohit/Land-Use-Classification | 998d6faae2ae67cfcf2f6c5098d4e918b99ae998 | [
"MIT"
] | 1 | 2021-09-30T02:34:59.000Z | 2021-09-30T02:36:54.000Z | datascienceUI.py | sarthakpurohit/Land-Use-Classification | 998d6faae2ae67cfcf2f6c5098d4e918b99ae998 | [
"MIT"
] | 1 | 2021-11-18T14:27:10.000Z | 2021-11-18T14:27:10.000Z | """Create an Image Classification Web App using PyTorch and Streamlit."""
# import libraries
from PIL import Image
from torchvision import models, transforms
import torch
import streamlit as st
import numpy as np
# set title of app
st.title("Simple Image Classification Application")
st.write("")
# enable users to up... | 33.252632 | 139 | 0.676163 |
32819947d916109fe6e857cf7c9cf98712029fb3 | 191 | py | Python | polls/views.py | dirias/polls_system | bc327b363c14c3dab51ef00a5b5e2488f3a14be7 | [
"MIT"
] | null | null | null | polls/views.py | dirias/polls_system | bc327b363c14c3dab51ef00a5b5e2488f3a14be7 | [
"MIT"
] | null | null | null | polls/views.py | dirias/polls_system | bc327b363c14c3dab51ef00a5b5e2488f3a14be7 | [
"MIT"
] | null | null | null | from http.client import HTTPResponse
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse('Hola')
| 21.222222 | 36 | 0.790576 |
406261d251553532ce7807954fbb28ec1f1f50f1 | 1,636 | py | Python | J_table.py | shivamp1495/FAST-PT | 137418e116f80d982427f13f4aed9273503952a8 | [
"MIT"
] | null | null | null | J_table.py | shivamp1495/FAST-PT | 137418e116f80d982427f13f4aed9273503952a8 | [
"MIT"
] | null | null | null | J_table.py | shivamp1495/FAST-PT | 137418e116f80d982427f13f4aed9273503952a8 | [
"MIT"
] | null | null | null | ''' This module tranforms a
set of l_1, l_2, and l in a
set of J_1, J_2, and J_k.
'''
import numpy as np
from numpy import pi
import sys
from Wigner_symbols import three_j, six_j
def J_range(l_a,l_b):
# returns J values for l_a, l_b such that
# | l_a - l_b | <= J <= l_a + l_b
start=np.absolute(l_a... | 26.387097 | 65 | 0.601467 |
769f54e9b298914d472cd85fbd6a6ac09599e78c | 17,130 | py | Python | datasets.py | Guanzhou-Ke/EMC-Net | 5d1da648b02100b54a3f6346a6cb7d0c2a189d28 | [
"MIT"
] | 4 | 2021-11-28T18:04:29.000Z | 2022-03-24T10:28:30.000Z | datasets.py | Guanzhou-Ke/EMC-Net | 5d1da648b02100b54a3f6346a6cb7d0c2a189d28 | [
"MIT"
] | null | null | null | datasets.py | Guanzhou-Ke/EMC-Net | 5d1da648b02100b54a3f6346a6cb7d0c2a189d28 | [
"MIT"
] | 3 | 2021-07-23T09:34:07.000Z | 2022-03-25T03:11:57.000Z | import os
import pickle as cPickle
import gzip
import cv2
import torch
import numpy as np
from torch.utils.data import Dataset
from sklearn.preprocessing import MinMaxScaler
import urllib.request
import scipy.io
class MNISTDataset(Dataset):
"""
Mnist-edge dataset.
Refer by:
Chao Shang, Aaron Palmer, ... | 42.718204 | 180 | 0.60502 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.