hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f707d1d9378240dadfe0c5fce252cd9de45207d3 | 3,701 | py | Python | demo/app.py | Mariatta/arq | 7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25 | [
"MIT"
] | 1 | 2021-01-03T00:57:38.000Z | 2021-01-03T00:57:38.000Z | demo/app.py | Mariatta/arq | 7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25 | [
"MIT"
] | null | null | null | demo/app.py | Mariatta/arq | 7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.6
import os
import asyncio
from time import time
import chevron
import uvloop
from aiohttp import web, ClientError, ClientSession
from aiohttp_session import SimpleCookieStorage, get_session
from aiohttp_session import setup as session_setup
from arq import Actor, BaseWorker, RedisSettings, conc... | 27.827068 | 100 | 0.634153 |
import os
import asyncio
from time import time
import chevron
import uvloop
from aiohttp import web, ClientError, ClientSession
from aiohttp_session import SimpleCookieStorage, get_session
from aiohttp_session import setup as session_setup
from arq import Actor, BaseWorker, RedisSettings, concurrent
R_OUTPUT = 'outp... | true | true |
f707d253c63d9914028eb228f855eea4ce59bc50 | 248 | py | Python | simple_fem/__init__.py | IgorBaratta/simple_fem | 292294fdcef263b3ddebdc79dfaa05cb2cefe60f | [
"MIT"
] | null | null | null | simple_fem/__init__.py | IgorBaratta/simple_fem | 292294fdcef263b3ddebdc79dfaa05cb2cefe60f | [
"MIT"
] | null | null | null | simple_fem/__init__.py | IgorBaratta/simple_fem | 292294fdcef263b3ddebdc79dfaa05cb2cefe60f | [
"MIT"
] | null | null | null | from .fem import DofMap, Q1Element
from .function_space import FunctionSpace
from .mesh import Mesh, ReferenceQuadrilateral
from .plot import plot
from .quadrature import Quadrature
from .assemble import assemble_vector, assemble_matrix, apply_bc
| 31 | 64 | 0.842742 | from .fem import DofMap, Q1Element
from .function_space import FunctionSpace
from .mesh import Mesh, ReferenceQuadrilateral
from .plot import plot
from .quadrature import Quadrature
from .assemble import assemble_vector, assemble_matrix, apply_bc
| true | true |
f707d39dbc4cb9a4b69e990dc483c17469e34d51 | 536 | py | Python | vmm/__main__.py | kmohrf/vmm | 5e0dc8c9502d07681bfaca8634ed5b083deae77b | [
"BSD-3-Clause"
] | 4 | 2020-03-08T08:45:35.000Z | 2021-10-17T11:05:17.000Z | vmm/__main__.py | kmohrf/vmm | 5e0dc8c9502d07681bfaca8634ed5b083deae77b | [
"BSD-3-Clause"
] | null | null | null | vmm/__main__.py | kmohrf/vmm | 5e0dc8c9502d07681bfaca8634ed5b083deae77b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright 2007 - 2014, Pascal Volk
# See COPYING for distribution information.
"""This is the vmm main script."""
import sys
if __name__ == "__main__":
# replace the script's cwd (/usr/local/sbin) with our module dir
# (the location of the vmm directory) - if ... | 28.210526 | 68 | 0.666045 |
import sys
if __name__ == "__main__":
# (the location of the vmm directory) - if it is not in sys.path
# sys.path[0] = '/usr/local/lib/vmm'
# Otherwise just remove /usr/local/sbin from sys.path
sys.path.remove(sys.path[0])
from vmm.cli.main import run
sys.exit(run(sys.argv))
| true | true |
f707d51f70d5c76439265b879aeec29bd4a6d006 | 2,533 | py | Python | tests/api/routes/test_routes_init.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-10-21T03:01:39.000Z | 2020-06-05T01:43:00.000Z | tests/api/routes/test_routes_init.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2019-07-12T21:16:03.000Z | 2020-11-06T23:29:22.000Z | tests/api/routes/test_routes_init.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-02-07T19:56:55.000Z | 2020-08-07T11:17:51.000Z | """Test initialization of the url factory classes"""
import unittest
from vizier.api.routes.base import UrlFactory
from vizier.api.routes.base import PROPERTIES_BASEURL, PROPERTIES_APIDOCURL
from vizier.api.routes.task import TaskUrlFactory
class TestUrlFactoryInit(unittest.TestCase):
def test_init_url_factory... | 37.80597 | 88 | 0.617055 |
import unittest
from vizier.api.routes.base import UrlFactory
from vizier.api.routes.base import PROPERTIES_BASEURL, PROPERTIES_APIDOCURL
from vizier.api.routes.task import TaskUrlFactory
class TestUrlFactoryInit(unittest.TestCase):
def test_init_url_factory(self):
urls = UrlFactory(base_url='http://ab... | true | true |
f707d527fa31fabb43356f22df07e5fa96b0e200 | 3,790 | py | Python | lib/protorpc-1.0/protorpc/message_types.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 76 | 2015-01-04T13:45:16.000Z | 2022-02-12T11:06:49.000Z | lib/protorpc-1.0/protorpc/message_types.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 27 | 2015-02-12T20:04:37.000Z | 2020-04-28T07:51:39.000Z | lib/protorpc-1.0/protorpc/message_types.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 42 | 2015-01-24T09:49:07.000Z | 2020-10-13T16:59:31.000Z | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 31.583333 | 78 | 0.687335 |
__author__ = 'rafek@google.com (Rafe Kaplan)'
import datetime
from . import messages
from . import util
__all__ = [
'DateTimeField',
'DateTimeMessage',
'VoidMessage',
]
class VoidMessage(messages.Message):
class DateTimeMessage(messages.Message):
milliseconds = messages.IntegerFiel... | true | true |
f707d5397bf7e46d6b3b59811c31a1684ec0baed | 11,809 | py | Python | tests/test-cluster.py | tripolkaandrey/microk8s | 6270ca450fab6bf98b25f0df473461210694775d | [
"Apache-2.0"
] | 1 | 2021-02-08T09:14:44.000Z | 2021-02-08T09:14:44.000Z | tests/test-cluster.py | tripolkaandrey/microk8s | 6270ca450fab6bf98b25f0df473461210694775d | [
"Apache-2.0"
] | 15 | 2021-05-02T05:10:59.000Z | 2022-03-09T22:27:19.000Z | tests/test-cluster.py | thanhtung22-cloud/microk8s | d1d02633ca245af9724094447be2e3c144526b35 | [
"Apache-2.0"
] | null | null | null | import string
import random
import time
import pytest
import os
import subprocess
from os import path
# Provide a list of VMs you want to reuse. VMs should have already microk8s installed.
# the test will attempt a refresh to the channel requested for testing
# reuse_vms = ['vm-ldzcjb', 'vm-nfpgea', 'vm-pkgbtw']
reus... | 39.494983 | 98 | 0.519519 | import string
import random
import time
import pytest
import os
import subprocess
from os import path
reuse_vms = None
channel_to_test = os.environ.get("CHANNEL_TO_TEST", "edge/ha-preview")
backend = os.environ.get("BACKEND", None)
class VM:
def __init__(self, attach_vm=None):
rnd_letters = "".join(... | true | true |
f707d5fe8383434cfbe843f45b38fefdbbbbb7fb | 526 | py | Python | python_toolbox/binary_search/__init__.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 119 | 2015-02-05T17:59:47.000Z | 2022-02-21T22:43:40.000Z | python_toolbox/binary_search/__init__.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 4 | 2019-04-24T14:01:14.000Z | 2020-05-21T12:03:29.000Z | python_toolbox/binary_search/__init__.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 14 | 2015-03-30T06:30:42.000Z | 2021-12-24T23:45:11.000Z | # Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
'''A package for doing a binary search in a sequence.'''
from .roundings import (Rounding, LOW, LOW_IF_BOTH, LOW_OTHERWISE_HIGH, HIGH,
HIGH_IF_BOTH, HIGH_OTHERWISE_LOW, EXACT, CLOSEST,
... | 47.818182 | 77 | 0.711027 |
from .roundings import (Rounding, LOW, LOW_IF_BOTH, LOW_OTHERWISE_HIGH, HIGH,
HIGH_IF_BOTH, HIGH_OTHERWISE_LOW, EXACT, CLOSEST,
CLOSEST_IF_BOTH, BOTH)
from .functions import (binary_search, binary_search_by_index,
make_both_data_into_preferred_... | true | true |
f707d613ff7ebc27f3707beca316b702b82b34b7 | 2,503 | py | Python | setup.py | haroldham/hive-sbi | 2d99703ee9e4675dbae986c1e656bf714b72d0b5 | [
"MIT"
] | 4 | 2018-09-23T07:56:18.000Z | 2020-04-08T03:29:19.000Z | setup.py | haroldham/hive-sbi | 2d99703ee9e4675dbae986c1e656bf714b72d0b5 | [
"MIT"
] | 10 | 2018-07-31T06:30:28.000Z | 2020-03-23T16:31:03.000Z | setup.py | haroldham/hive-sbi | 2d99703ee9e4675dbae986c1e656bf714b72d0b5 | [
"MIT"
] | 9 | 2018-07-16T20:19:29.000Z | 2021-04-14T23:58:42.000Z | # -*- coding: utf-8 -*-
"""Packaging logic for beem."""
import codecs
import io
import os
import sys
from setuptools import setup
# Work around mbcs bug in distutils.
# http://bugs.python.org/issue10945
try:
codecs.lookup('mbcs')
except LookupError:
ascii = codecs.lookup('ascii')
codecs.register(lambda n... | 28.443182 | 86 | 0.596884 |
import codecs
import io
import os
import sys
from setuptools import setup
try:
codecs.lookup('mbcs')
except LookupError:
ascii = codecs.lookup('ascii')
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs'))
VERSION = '0.1.2'
tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock'... | true | true |
f707d72b8bccb6192906d8fac11ec9b1ba13c7c0 | 369 | py | Python | tools/c7n_mailer/c7n_mailer/utils_email.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | null | null | null | tools/c7n_mailer/c7n_mailer/utils_email.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | null | null | null | tools/c7n_mailer/c7n_mailer/utils_email.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | null | null | null | import logging
from email.utils import parseaddr
logger = logging.getLogger('c7n_mailer.utils.email')
def is_email(target):
if target.startswith('slack://'):
logger.debug("Slack payload, not an email.")
return False
if parseaddr(target)[1] and '@' in target and '.' in target:
... | 24.6 | 65 | 0.631436 | import logging
from email.utils import parseaddr
logger = logging.getLogger('c7n_mailer.utils.email')
def is_email(target):
if target.startswith('slack://'):
logger.debug("Slack payload, not an email.")
return False
if parseaddr(target)[1] and '@' in target and '.' in target:
... | true | true |
f707d8d338f577afbfffde813e38b1c37c20c5c9 | 1,525 | py | Python | spin/models/smpl.py | krumo/SPIN | 0e2f17e70f06de46e062683ea6d5b233eeaa73c1 | [
"BSD-3-Clause"
] | null | null | null | spin/models/smpl.py | krumo/SPIN | 0e2f17e70f06de46e062683ea6d5b233eeaa73c1 | [
"BSD-3-Clause"
] | null | null | null | spin/models/smpl.py | krumo/SPIN | 0e2f17e70f06de46e062683ea6d5b233eeaa73c1 | [
"BSD-3-Clause"
] | null | null | null | import torch
import numpy as np
import smplx
from smplx import SMPL as _SMPL
from smplx.body_models import ModelOutput
from smplx.lbs import vertices2joints
import spin.config as config
import spin.constants as constants
class SMPL(_SMPL):
""" Extension of the official SMPL implementation to support more joints "... | 42.361111 | 103 | 0.658361 | import torch
import numpy as np
import smplx
from smplx import SMPL as _SMPL
from smplx.body_models import ModelOutput
from smplx.lbs import vertices2joints
import spin.config as config
import spin.constants as constants
class SMPL(_SMPL):
def __init__(self, *args, **kwargs):
super(SMPL, self).__init__(*... | true | true |
f707d9f5ae195709bc3343f36776ae832f905010 | 522 | py | Python | Python_Implementation/Test_Codes/Test1.py | ishtiaqniloy/CSE_406_TCP_Reset_Attack_Video_Streaming | 849e3595a75cedaa8142a025eb22e1bb8871be36 | [
"MIT"
] | 2 | 2019-09-08T15:12:38.000Z | 2019-09-23T04:36:18.000Z | Python_Implementation/Test_Codes/Test1.py | ishtiaqniloy/CSE_406_TCP_Reset_Attack_Video_Streaming | 849e3595a75cedaa8142a025eb22e1bb8871be36 | [
"MIT"
] | null | null | null | Python_Implementation/Test_Codes/Test1.py | ishtiaqniloy/CSE_406_TCP_Reset_Attack_Video_Streaming | 849e3595a75cedaa8142a025eb22e1bb8871be36 | [
"MIT"
] | 1 | 2021-05-25T09:58:46.000Z | 2021-05-25T09:58:46.000Z | from scapy.all import *
from scapy.all import send
from scapy.layers.inet import *
srcIP = "192.168.0.103"
destIP = "192.168.0.108"
def spoof_tcp(pkt):
IPLayer = IP(dst=destIP, src=pkt[IP].dst)
TCPLayer = TCP(flags="R", seq=pkt[TCP].ack, dport=pkt[TCP].sport, sport=pkt[TCP].dport)
spoofpkt = IPLayer/TCPLa... | 22.695652 | 91 | 0.655172 | from scapy.all import *
from scapy.all import send
from scapy.layers.inet import *
srcIP = "192.168.0.103"
destIP = "192.168.0.108"
def spoof_tcp(pkt):
IPLayer = IP(dst=destIP, src=pkt[IP].dst)
TCPLayer = TCP(flags="R", seq=pkt[TCP].ack, dport=pkt[TCP].sport, sport=pkt[TCP].dport)
spoofpkt = IPLayer/TCPLa... | true | true |
f707da107d989b56c26b40432ff8a4818a50ba27 | 3,748 | py | Python | joswig_dijkstra.py | MrCopprHead/joswig | addd43e29270320e69d038ef5b24b717c2740061 | [
"MIT"
] | null | null | null | joswig_dijkstra.py | MrCopprHead/joswig | addd43e29270320e69d038ef5b24b717c2740061 | [
"MIT"
] | null | null | null | joswig_dijkstra.py | MrCopprHead/joswig | addd43e29270320e69d038ef5b24b717c2740061 | [
"MIT"
] | null | null | null | #Attempt to route using the Joswig Algorithm described here: https://arxiv.org/pdf/1904.01082.pdf
#using object oriented programming.
class Vertex:
num_vert = 0
vertices = []
def __init__(self, lab=""):
self.label = lab
self.adj = [] #adjacency list
self.weight = [] ... | 32.310345 | 98 | 0.509872 |
class Vertex:
num_vert = 0
vertices = []
def __init__(self, lab=""):
self.label = lab
self.adj = []
self.weight = []
self.known = False
self.pv = None
self.dv = 0
self.help = False
Vertex.num_vert += 1
... | true | true |
f707dc3bea0d922a73defd241268b992e7ca7392 | 971 | py | Python | creational/singleton.py | rcavaz/Design-Patterns | d40718926be14a5da7e7deb3c6d31d5259eee1dd | [
"MIT"
] | 3 | 2018-01-12T01:45:00.000Z | 2019-03-07T20:12:23.000Z | creational/singleton.py | rcavaz/Design-Patterns | d40718926be14a5da7e7deb3c6d31d5259eee1dd | [
"MIT"
] | null | null | null | creational/singleton.py | rcavaz/Design-Patterns | d40718926be14a5da7e7deb3c6d31d5259eee1dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
SINGLETON
Use the Singleton pattern when:
1. there must be exactly one instance of a class, and it must be
accessible to clients from a well-known access point.
2. the sole instance should be extensible by subclassing, and clients
should be able to use an extended instan... | 28.558824 | 79 | 0.677652 |
import logging
class Connection(object):
def __new__(type):
if not '_connection' in type.__dict__:
type._connection = object.__new__(type)
logging.basicConfig(level=logging.INFO)
logging.info('New database connection created!')
logging.info('Connection establi... | true | true |
f707dca08d914b63cf7af7cdfd1b67909756c739 | 1,597 | py | Python | nacos/base.py | hubertshelley/nacos_client_python | 38f9b4fe26096626328d5f2149b144b9b5933a11 | [
"Apache-2.0"
] | null | null | null | nacos/base.py | hubertshelley/nacos_client_python | 38f9b4fe26096626328d5f2149b144b9b5933a11 | [
"Apache-2.0"
] | null | null | null | nacos/base.py | hubertshelley/nacos_client_python | 38f9b4fe26096626328d5f2149b144b9b5933a11 | [
"Apache-2.0"
] | null | null | null | import socket
from http import HTTPStatus
from urllib.request import Request, urlopen, ProxyHandler, build_opener
from urllib.parse import urlencode, unquote_plus, quote, quote_plus
from urllib.error import HTTPError, URLError
class ClientBase:
def __init__(self, nacos_host: str, api_level: str = 'v1'):
s... | 38.95122 | 109 | 0.577959 | import socket
from http import HTTPStatus
from urllib.request import Request, urlopen, ProxyHandler, build_opener
from urllib.parse import urlencode, unquote_plus, quote, quote_plus
from urllib.error import HTTPError, URLError
class ClientBase:
def __init__(self, nacos_host: str, api_level: str = 'v1'):
s... | true | true |
f707dcc5768824ef0e014152f92bc6655d9355f0 | 657 | py | Python | tridentstream/notifiers/multinotifier/handler.py | tridentstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | 6 | 2020-01-03T14:50:09.000Z | 2021-09-13T01:44:31.000Z | tridentstream/notifiers/multinotifier/handler.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | tridentstream/notifiers/multinotifier/handler.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | import logging
from django.contrib.auth.models import User
from unplugged import RelatedPluginField, Schema, fields
from wampyre.realm import realm_manager
from ...plugins import NotifierPlugin
logger = logging.getLogger(__name__)
class MultiNotifierSchema(Schema):
notifiers = fields.List(
RelatedPlugi... | 26.28 | 79 | 0.762557 | import logging
from django.contrib.auth.models import User
from unplugged import RelatedPluginField, Schema, fields
from wampyre.realm import realm_manager
from ...plugins import NotifierPlugin
logger = logging.getLogger(__name__)
class MultiNotifierSchema(Schema):
notifiers = fields.List(
RelatedPlugi... | true | true |
f707dcef9260b20e07d25e398446967df4b622c2 | 1,410 | py | Python | elit/datasets/sts/stsb.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | 4 | 2021-09-17T15:23:31.000Z | 2022-02-28T10:18:04.000Z | elit/datasets/sts/stsb.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | elit/datasets/sts/stsb.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-05-20 16:25
from typing import Union, List, Callable
from elit.common.dataset import TransformableDataset
from elit.utils.io_util import read_cells
STS_B_TRAIN = 'http://ixa2.si.ehu.es/stswiki/images/4/48/Stsbenchmark.tar.gz#sts-train.csv'
STS_B_DEV = 'http://ixa2.... | 38.108108 | 94 | 0.628369 |
from typing import Union, List, Callable
from elit.common.dataset import TransformableDataset
from elit.utils.io_util import read_cells
STS_B_TRAIN = 'http://ixa2.si.ehu.es/stswiki/images/4/48/Stsbenchmark.tar.gz#sts-train.csv'
STS_B_DEV = 'http://ixa2.si.ehu.es/stswiki/images/4/48/Stsbenchmark.tar.gz#sts-dev.csv'... | true | true |
f707ddcb48b0d243878fade85e7923d452e6caaf | 771 | py | Python | utils/censor.py | GlobalChatDev/DeveloperGlobalChat | 8f52e778e3730add307cfafbdb0e3b71a562462f | [
"MIT"
] | 4 | 2021-11-22T00:31:19.000Z | 2022-03-05T13:38:36.000Z | utils/censor.py | GlobalChatDev/DeveloperGlobalChat | 8f52e778e3730add307cfafbdb0e3b71a562462f | [
"MIT"
] | null | null | null | utils/censor.py | GlobalChatDev/DeveloperGlobalChat | 8f52e778e3730add307cfafbdb0e3b71a562462f | [
"MIT"
] | 1 | 2022-02-27T21:26:20.000Z | 2022-02-27T21:26:20.000Z | from typing import *
import re
class Censorship:
def __init__(self, content: Union[Any, str, None] = None) -> None:
self.content: str = content
def update_content(self, content: Any):
self.content = content
def censor(self):
censored = ["fuck", "shit", "lmao", "lmfao", "porn", "s... | 30.84 | 91 | 0.509728 | from typing import *
import re
class Censorship:
def __init__(self, content: Union[Any, str, None] = None) -> None:
self.content: str = content
def update_content(self, content: Any):
self.content = content
def censor(self):
censored = ["fuck", "shit", "lmao", "lmfao", "porn", "s... | true | true |
f707de3705af2a4dae494700ab92a8eb9604d0f0 | 389 | py | Python | opinions/united_states/state/ohioctapp_2.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | opinions/united_states/state/ohioctapp_2.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | opinions/united_states/state/ohioctapp_2.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | """Scraper for the 1st District Court of Appeals
CourtID: ohio
Court Short Name: Ohio
Author: Andrei Chelaru
"""
from juriscraper.opinions.united_states.state import ohio
class Site(ohio.Site):
def __init__(self):
super(Site, self).__init__()
self.court_id = self.__module__
self.court_ind... | 24.3125 | 61 | 0.70437 |
from juriscraper.opinions.united_states.state import ohio
class Site(ohio.Site):
def __init__(self):
super(Site, self).__init__()
self.court_id = self.__module__
self.court_index = 2
self.url = self.make_url(self.court_index, self.year)
| true | true |
f707de5d7baf6c48523186021b7d2ca01cdbe868 | 220 | py | Python | tflib/__init__.py | nguyenquangduc2000/AttGAN | 2ba96d1a1f80b39cc785c594ad8e1d800c06dd52 | [
"MIT"
] | 405 | 2019-04-17T03:02:18.000Z | 2022-03-11T06:36:00.000Z | tflib/__init__.py | nguyenquangduc2000/AttGAN | 2ba96d1a1f80b39cc785c594ad8e1d800c06dd52 | [
"MIT"
] | 58 | 2019-05-13T09:34:57.000Z | 2021-12-07T08:40:58.000Z | tflib/__init__.py | nguyenquangduc2000/AttGAN | 2ba96d1a1f80b39cc785c594ad8e1d800c06dd52 | [
"MIT"
] | 95 | 2019-04-20T02:32:32.000Z | 2022-03-07T03:58:24.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tflib.checkpoint import *
from tflib.ops import *
from tflib.utils import *
from tflib.variable import *
| 24.444444 | 38 | 0.831818 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tflib.checkpoint import *
from tflib.ops import *
from tflib.utils import *
from tflib.variable import *
| true | true |
f707de66a1a318b60effa45ff1790f7b9c557bb8 | 116 | py | Python | holygun/bot.py | TitaniumHocker/Holygun | b1860ca7586c222e68ab79d1408126f757cc2057 | [
"MIT"
] | null | null | null | holygun/bot.py | TitaniumHocker/Holygun | b1860ca7586c222e68ab79d1408126f757cc2057 | [
"MIT"
] | null | null | null | holygun/bot.py | TitaniumHocker/Holygun | b1860ca7586c222e68ab79d1408126f757cc2057 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from discord.ext import commands
import discord
client = commands.Bot(command_prefix='.')
| 16.571429 | 41 | 0.706897 |
from discord.ext import commands
import discord
client = commands.Bot(command_prefix='.')
| true | true |
f707dec50aebb6bb333e897656608d4ecdba6528 | 5,601 | py | Python | portfolio/Python/scrapy/gadgetpanda/sellusyourgadget_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/gadgetpanda/sellusyourgadget_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/gadgetpanda/sellusyourgadget_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | import os
import csv
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest
from product_spiders.fuzzywuzzy import process
from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader
HERE = os.path.abspath(os.path.dirn... | 51.861111 | 119 | 0.466702 | import os
import csv
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest
from product_spiders.fuzzywuzzy import process
from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader
HERE = os.path.abspath(os.path.dirn... | true | true |
f707dfbc174261fab6b852262aa102e8664820a1 | 1,335 | py | Python | src/python/WMCore/BossAir/MySQL/LoadForMonitoring.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/BossAir/MySQL/LoadForMonitoring.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/BossAir/MySQL/LoadForMonitoring.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_LoadForMonitoring_
MySQL implementation for loading a job by scheduler status
"""
from WMCore.Database.DBFormatter import DBFormatter
class LoadForMonitoring(DBFormatter):
"""
_LoadForMonitoring_
Load all jobs with a certain scheduler status including
all the joined infor... | 28.404255 | 86 | 0.617978 |
from WMCore.Database.DBFormatter import DBFormatter
class LoadForMonitoring(DBFormatter):
sql = """SELECT rj.wmbs_id AS jobid, rj.grid_id AS gridid, rj.bulk_id AS bulkid,
st.name AS status, rj.retry_count as retry_count, rj.id AS id,
rj.status_time as status_time, wl.plugin AS pl... | true | true |
f707e00a97a99d4a6c312d59ee4e46abeccbb04f | 407 | py | Python | myscraper/spiders/myscraper.py | melki/scrapeSlate | f1583e49e29cef6670a1f390f918207fa63646a5 | [
"MIT"
] | null | null | null | myscraper/spiders/myscraper.py | melki/scrapeSlate | f1583e49e29cef6670a1f390f918207fa63646a5 | [
"MIT"
] | null | null | null | myscraper/spiders/myscraper.py | melki/scrapeSlate | f1583e49e29cef6670a1f390f918207fa63646a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from scrapy import Spider, Request
from ..items import Article
from ..items import Lien
class MyScraper(Spider):
name = u'myscraper'
def start_requests(self):
urlToVisit = {}
Request(
url='http://www.google.fr/',
callback=self.parse,
... | 16.958333 | 40 | 0.55774 |
from scrapy import Spider, Request
from ..items import Article
from ..items import Lien
class MyScraper(Spider):
name = u'myscraper'
def start_requests(self):
urlToVisit = {}
Request(
url='http://www.google.fr/',
callback=self.parse,
)
def parse(self,... | true | true |
f707e1277f32bfebfdc9ac2cf05c0ae86aa33b5f | 8,465 | py | Python | docs/conf.py | liuzh91/gluon-nlp | 189bbdcc56d8e58aa908963949687b99ff9a3cff | [
"Apache-2.0"
] | 1 | 2021-06-17T12:59:25.000Z | 2021-06-17T12:59:25.000Z | docs/conf.py | liuzh91/gluon-nlp | 189bbdcc56d8e58aa908963949687b99ff9a3cff | [
"Apache-2.0"
] | 3 | 2020-09-01T05:45:57.000Z | 2020-10-22T23:14:20.000Z | docs/conf.py | ZiyueHuang/gluon-nlp | 0d5c61992180f41eab590e74c7b679980f429292 | [
"Apache-2.0"
] | 1 | 2020-09-04T22:28:31.000Z | 2020-09-04T22:28:31.000Z | # documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 23 19:40:08 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a def... | 31.823308 | 100 | 0.695334 |
import sys
import os, subprocess
import shlex
import recommonmark
import sphinx_gallery
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(curr_path, '... | true | true |
f707e18686892825bbfde8338065f25653edad29 | 4,210 | py | Python | analysis/coarse_graining.py | yketa/UBC---Spring-2018---code | b065544639a483dda48cda89bcbb11c1772232aa | [
"MIT"
] | 1 | 2021-12-15T13:38:13.000Z | 2021-12-15T13:38:13.000Z | analysis/coarse_graining.py | yketa/UBC---Spring-2018---code | b065544639a483dda48cda89bcbb11c1772232aa | [
"MIT"
] | 1 | 2019-05-25T20:00:17.000Z | 2019-05-25T20:00:17.000Z | analysis/coarse_graining.py | yketa/UBC---Spring-2018---code | b065544639a483dda48cda89bcbb11c1772232aa | [
"MIT"
] | 1 | 2020-01-22T17:05:18.000Z | 2020-01-22T17:05:18.000Z | """
Module coarse_graining implements a Gaussian coarse-graining adapted from
Illing et al., Phys. Rev. Lett. 117, 208002 (2016) following Goldhirsch and
Goldenberg, Eur. Phys. J. E 9, 245–251 (2002).
"""
import numpy as np
class GaussianCG:
"""
Gaussian coarse-graining.
"""
def __init__(self, sigma,... | 26.987179 | 117 | 0.539905 |
import numpy as np
class GaussianCG:
def __init__(self, sigma, r_cut):
self.sigma = sigma
self.r_cut = r_cut
def function(self, r):
if r > self.r_cut: return 0
Dg = 2*np.pi*(self.sigma**2)*(1 -
np.exp(-0.5*((self.r_cut/self.sigma)**2)))
return np... | true | true |
f707e18b95fefa6dc45d4e780606b33415022b2a | 1,715 | py | Python | test/functional/feature_uacomment.py | dogxteam/dogxwallet-master | 346189354bdec9a80c20bdc429ddec15c3b17b73 | [
"MIT"
] | 5 | 2019-03-18T02:14:20.000Z | 2019-03-21T17:08:27.000Z | test/functional/feature_uacomment.py | dogxteam/dogxwallet-master | 346189354bdec9a80c20bdc429ddec15c3b17b73 | [
"MIT"
] | null | null | null | test/functional/feature_uacomment.py | dogxteam/dogxwallet-master | 346189354bdec9a80c20bdc429ddec15c3b17b73 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The dogxcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -uacomment option."""
import re
from test_framework.test_framework import dogxcoinTestFrame... | 41.829268 | 150 | 0.689213 |
import re
from test_framework.test_framework import dogxcoinTestFramework
from test_framework.test_node import ErrorMatch
from test_framework.util import assert_equal
class UacommentTest(dogxcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
... | true | true |
f707e23b55d940cd1262516340bb49b3d5e18399 | 2,673 | py | Python | tests/services/schemas/test_access.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 10 | 2020-01-17T10:13:09.000Z | 2022-03-17T10:14:41.000Z | tests/services/schemas/test_access.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 570 | 2019-08-15T16:35:25.000Z | 2022-03-31T13:46:17.000Z | tests/services/schemas/test_access.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 57 | 2019-09-04T09:25:29.000Z | 2022-03-30T19:32:55.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020-2021 CERN.
# Copyright (C) 2020-2021 Northwestern University.
# Copyright (C) 2021 TU Wien.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Test metadata ac... | 28.136842 | 79 | 0.601571 |
import pytest
from marshmallow.exceptions import ValidationError
from invenio_rdm_records.services.schemas.access import AccessSchema, \
EmbargoSchema
def test_embargo_load_no_until_is_valid():
expected = {
"active": False,
"until": None,
"reason": None
}
valid_no_u... | true | true |
f707e2b06dbe69bf58625f3d2057eaab1323eae7 | 2,467 | py | Python | src/movement/dc_with_ultra.py | Quanta-Robotics/Robot-Blueberry | 7b7e77e09ac5e9ec5afd947e0db1ecc8773e56da | [
"MIT"
] | 25 | 2021-06-08T07:09:30.000Z | 2021-12-30T06:28:35.000Z | src/movement/dc_with_ultra.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 2 | 2021-05-23T12:54:51.000Z | 2021-06-07T17:47:56.000Z | src/movement/dc_with_ultra.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 14 | 2021-06-08T13:02:28.000Z | 2021-12-30T20:07:18.000Z | from expression import *
# programming the GPIO by BCM pin numbers
#TRIG = servo['Sensor']['ultrasonic']['trigger']
#ECHO = servo['Sensor']['ultrasonic']['echo']
TRIG = 24
ECHO = 23
GPIO.setup(TRIG,GPIO.OUT) # initialize GPIO Pin as outputs
GPIO.setup(ECHO,GPIO.IN) # initialize GPIO... | 28.034091 | 108 | 0.511147 | from expression import *
TRIG = 24
ECHO = 23
GPIO.setup(TRIG,GPIO.OUT)
GPIO.setup(ECHO,GPIO.IN)
def forward():
Run(1,0,1,0,80)
def back():
Run(0,1,0,1,80)
def left():
Run(0,1,1,0,80)
def right():
Run(1,0,0,1,80)
Stop()
count=0
def Distance():
avgDistanc... | true | true |
f707e323b5012ccf55f0e28d9d20cc066ceefb85 | 1,916 | py | Python | tamusers/management/commands/sync_tamusers.py | Tampere/django-tamusers | 5b3d82332c435990dad98f64bb9094cc1502b7ef | [
"BSD-2-Clause"
] | null | null | null | tamusers/management/commands/sync_tamusers.py | Tampere/django-tamusers | 5b3d82332c435990dad98f64bb9094cc1502b7ef | [
"BSD-2-Clause"
] | 1 | 2020-04-20T14:05:28.000Z | 2020-04-20T14:05:28.000Z | tamusers/management/commands/sync_tamusers.py | Tampere/django-tamusers | 5b3d82332c435990dad98f64bb9094cc1502b7ef | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
from allauth.socialaccount.models import SocialApp
from tamusers.providers.tampere.provider import TampereProvider
class Command(Bas... | 36.150943 | 114 | 0.653967 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
from allauth.socialaccount.models import SocialApp
from tamusers.providers.tampere.provider import TampereProvider
class Command(Bas... | true | true |
f707e4491d0edf77917437d57d826e828a2fb974 | 19,684 | py | Python | cirq-core/cirq/work/observable_measurement_data_test.py | Nexuscompute/Cirq | 640ef8f82d6a56ec95361388ce7976e096cca906 | [
"Apache-2.0"
] | 1 | 2022-02-05T22:17:39.000Z | 2022-02-05T22:17:39.000Z | cirq-core/cirq/work/observable_measurement_data_test.py | pavoljuhas/Cirq | b6d6577be61d216ce2f29f8c64ae5879cf3087d5 | [
"Apache-2.0"
] | 4 | 2022-01-16T14:12:15.000Z | 2022-02-24T03:58:46.000Z | cirq-core/cirq/work/observable_measurement_data_test.py | Nexuscompute/Cirq | 640ef8f82d6a56ec95361388ce7976e096cca906 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 35.024911 | 96 | 0.624416 |
import dataclasses
import datetime
import time
import numpy as np
import pytest
import cirq
import cirq.work as cw
from cirq.work.observable_measurement_data import (
_check_and_get_real_coef,
_obs_vals_from_measurements,
_stats_from_measurements,
)
from cirq.work.observable_settings import _... | true | true |
f707e5ac07ee0b8d1e609c00662e283e6331f036 | 1,500 | py | Python | vnpy_huobi/__init__.py | noranhe/vnpy_huobi | 9f4a8abe9c6716492fccec6a58bb1e054490b8c2 | [
"MIT"
] | null | null | null | vnpy_huobi/__init__.py | noranhe/vnpy_huobi | 9f4a8abe9c6716492fccec6a58bb1e054490b8c2 | [
"MIT"
] | null | null | null | vnpy_huobi/__init__.py | noranhe/vnpy_huobi | 9f4a8abe9c6716492fccec6a58bb1e054490b8c2 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2015-present, Xiaoyou Chen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, c... | 42.857143 | 80 | 0.795333 |
import importlib_metadata
from .huobi_spot_gateway import HuobiSpotGateway
from .huobi_futures_gateway import HuobiFuturesGateway
from .huobi_usdt_gateway import HuobiUsdtGateway
from .huobi_inverse_gateway import HuobiInverseGateway
try:
__version__ = importlib_metadata.version("vnpy_huobi... | true | true |
f707e851434ea098122462fc160ade2093d6c2f0 | 35,468 | py | Python | frontends/etiquette_cli.py | voussoir/etiquette | e982858c28335b11528c52af181abd1bbc71673f | [
"BSD-3-Clause"
] | 20 | 2018-03-20T01:40:13.000Z | 2022-02-11T20:23:41.000Z | frontends/etiquette_cli.py | voussoir/etiquette | e982858c28335b11528c52af181abd1bbc71673f | [
"BSD-3-Clause"
] | null | null | null | frontends/etiquette_cli.py | voussoir/etiquette | e982858c28335b11528c52af181abd1bbc71673f | [
"BSD-3-Clause"
] | 1 | 2018-03-20T13:10:31.000Z | 2018-03-20T13:10:31.000Z | import argparse
import os
import re
import sys
from voussoirkit import betterhelp
from voussoirkit import interactive
from voussoirkit import pathclass
from voussoirkit import pipeable
from voussoirkit import spinal
from voussoirkit import stringtools
from voussoirkit import vlogging
import etiquette
# HELPERS #####... | 33.054986 | 129 | 0.687662 | import argparse
import os
import re
import sys
from voussoirkit import betterhelp
from voussoirkit import interactive
from voussoirkit import pathclass
from voussoirkit import pipeable
from voussoirkit import spinal
from voussoirkit import stringtools
from voussoirkit import vlogging
import etiquette
if len(check.l... | true | true |
f707e8b56ef15989602ef9fa6ae6524c8a27ce3b | 7,549 | py | Python | python/tests/wrapper/test_05_multimodal.py | menshikh-iv/bigartm | 9be401f740402814fe79ff4a6cebfd3db0bf992f | [
"BSD-3-Clause"
] | 638 | 2015-02-03T22:17:00.000Z | 2022-03-23T18:47:50.000Z | python/tests/wrapper/test_05_multimodal.py | menshikh-iv/bigartm | 9be401f740402814fe79ff4a6cebfd3db0bf992f | [
"BSD-3-Clause"
] | 566 | 2015-01-01T21:49:00.000Z | 2022-02-14T09:14:35.000Z | python/tests/wrapper/test_05_multimodal.py | bt2901/bigartm | 92c9d5746c122d0124bab700469d8a2a7f58ff40 | [
"BSD-3-Clause"
] | 148 | 2015-01-06T15:30:07.000Z | 2022-02-12T18:40:17.000Z | # -*- coding: utf-8 -*-
# Copyright 2017, Additive Regularization of Topic Models.
from __future__ import print_function
import os
import uuid
import string
import itertools
import tempfile
import shutil
import pytest
from six.moves import range, zip
import artm.wrapper
import artm.wrapper.messages_pb2 as messages... | 37.371287 | 108 | 0.616903 |
from __future__ import print_function
import os
import uuid
import string
import itertools
import tempfile
import shutil
import pytest
from six.moves import range, zip
import artm.wrapper
import artm.wrapper.messages_pb2 as messages
import artm.master_component as mc
def _print_top_tokens(top_tokens_score, expe... | true | true |
f707e8d92417a3709eee2909a385d1cc48e469bf | 213 | py | Python | src/accounts/models.py | rafaellcoellho/pergunteme | df60823c311657a85d54eedbef4c95997c17e9b7 | [
"MIT"
] | null | null | null | src/accounts/models.py | rafaellcoellho/pergunteme | df60823c311657a85d54eedbef4c95997c17e9b7 | [
"MIT"
] | null | null | null | src/accounts/models.py | rafaellcoellho/pergunteme | df60823c311657a85d54eedbef4c95997c17e9b7 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser):
pass
# add additional fields in here
def __str__(self):
return self.username
| 19.363636 | 51 | 0.737089 | from django.db import models
from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser):
pass
def __str__(self):
return self.username
| true | true |
f707e9b1b9ea3839eac0a69112f41e93fa9c360a | 1,447 | py | Python | general_modules/postprocess_decoded_seq.py | johntsi/preast_qa | e95fb167f4fdeb8868fed935f88493450ea10ddd | [
"MIT"
] | null | null | null | general_modules/postprocess_decoded_seq.py | johntsi/preast_qa | e95fb167f4fdeb8868fed935f88493450ea10ddd | [
"MIT"
] | null | null | null | general_modules/postprocess_decoded_seq.py | johntsi/preast_qa | e95fb167f4fdeb8868fed935f88493450ea10ddd | [
"MIT"
] | null | null | null | def postprocess_decoded_seq(answers):
"""
Corrects for some extra spaces that are created by the decode method
of the tokenizer like in numerical strings
example: 1, 000, 000 --> 1,000,000
Args:
answers: list[str]
Returns:
new_answers: list[str]
"""
new_answers = []
for answer in answers:
parts = an... | 22.968254 | 69 | 0.565999 | def postprocess_decoded_seq(answers):
new_answers = []
for answer in answers:
parts = answer.split(", ")
if len(parts) > 1:
try:
new0 = parts[0]
for i in range(1, len(parts)):
if new0[-1].isnumeric() and parts[i][0].isnumeric():
if len(parts[i]) > 3 and parts[i][3].isnumeric():
ne... | true | true |
f707ec62b70359ffbd3ab48f3f38674053d85189 | 10,193 | py | Python | omop_harvest/conf/base.py | chop-dbhi/omop_harvest | ed2f5101941b48ea1a76761ae05162b89ead5bb7 | [
"BSD-2-Clause"
] | 4 | 2015-01-21T13:48:33.000Z | 2017-02-22T15:22:39.000Z | omop_harvest/conf/base.py | chop-dbhi/omop_harvest | ed2f5101941b48ea1a76761ae05162b89ead5bb7 | [
"BSD-2-Clause"
] | 2 | 2015-01-29T19:24:24.000Z | 2015-04-10T21:04:53.000Z | omop_harvest/conf/base.py | chop-dbhi/omop_harvest | ed2f5101941b48ea1a76761ae05162b89ead5bb7 | [
"BSD-2-Clause"
] | 2 | 2015-01-28T01:07:01.000Z | 2015-07-22T17:36:21.000Z | import os
# Import global settings to make it easier to extend settings.
from django.conf.global_settings import *
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
""" Get the environment variable or return an exception"""
try:
return os.environ[var_name]
exc... | 26.613577 | 81 | 0.672913 | import os
from django.conf.global_settings import *
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
try:
return os.environ[var_name]
except KeyError:
error_msg = "Set the %s environment variable" % var_name
raise ImproperlyConfigured(error_msg)
... | true | true |
f707ed0c7e8ee188d0347cf515666d3fbef96b5e | 1,580 | py | Python | wsltools/similar.py | Symbo1/wsltools | 0b6e536fc85c707a1c81f0296c4e91ca835396a1 | [
"MIT"
] | 412 | 2020-04-16T08:11:58.000Z | 2022-02-02T19:49:53.000Z | wsltools/similar.py | Symbo1/wsltools | 0b6e536fc85c707a1c81f0296c4e91ca835396a1 | [
"MIT"
] | 1 | 2020-04-16T14:03:46.000Z | 2020-04-17T03:41:18.000Z | wsltools/similar.py | Symbo1/wsltools | 0b6e536fc85c707a1c81f0296c4e91ca835396a1 | [
"MIT"
] | 33 | 2020-04-16T08:48:53.000Z | 2021-10-20T04:39:29.000Z | # -*- coding: utf-8 -*-
__author__ = 'CongRong <tr3jer@gmail.com>'
import difflib
from .utils.compat import bytes_decode, xrange
hashbits = 128
difflib_threshold = 0.95
simhash_threshold = 0.95
def simhash(tokens):
v = [0] * hashbits
for t in [string_hash(x) for x in tokens]:
for i in xrange(hashbits):
bi... | 19.268293 | 100 | 0.643038 |
__author__ = 'CongRong <tr3jer@gmail.com>'
import difflib
from .utils.compat import bytes_decode, xrange
hashbits = 128
difflib_threshold = 0.95
simhash_threshold = 0.95
def simhash(tokens):
v = [0] * hashbits
for t in [string_hash(x) for x in tokens]:
for i in xrange(hashbits):
bitmask = 1 << i
if t ... | true | true |
f707edd2b040f0802a1354f8b3a12e88d8aee693 | 58 | py | Python | essentials/hello.py | ariannasg/python3-essential-training | 9b52645f5ccb57d2bda5d5f4a3053681a026450a | [
"MIT"
] | 1 | 2020-06-02T08:37:41.000Z | 2020-06-02T08:37:41.000Z | essentials/hello.py | ariannasg/python3-training | 9b52645f5ccb57d2bda5d5f4a3053681a026450a | [
"MIT"
] | null | null | null | essentials/hello.py | ariannasg/python3-training | 9b52645f5ccb57d2bda5d5f4a3053681a026450a | [
"MIT"
] | null | null | null | print('Hello, World.')
# CONSOLE OUTPUT:
# Hello, World.
| 11.6 | 22 | 0.655172 | print('Hello, World.')
| true | true |
f707ef2ead5ec54c7eb2427bced3cc02f631c7dd | 31,651 | py | Python | request.py | alexcornier/INSEE | a5dc6e1267834754ac1cd1331203b5e835828946 | [
"MIT"
] | 1 | 2020-08-25T16:20:03.000Z | 2020-08-25T16:20:03.000Z | request.py | alexcornier/INSEE | a5dc6e1267834754ac1cd1331203b5e835828946 | [
"MIT"
] | null | null | null | request.py | alexcornier/INSEE | a5dc6e1267834754ac1cd1331203b5e835828946 | [
"MIT"
] | null | null | null | #================================================================
# Ensemble de requêtes SQL sur une base de données SQL
# hébergées sur un serveur local postgresql
#
# Modules pythons nécessaires
# psycopg2 (SQL connection)
# pandas (DataFrame et HTML)
# matplotlib
# jinja2 (styles HTML)
#
# Alexandre Cornier ... | 45.02276 | 138 | 0.563616 |
import psycopg2
import pandas as pd
import webbrowser
import pathlib
bconsole = False # pas d'affichage console par défaut
connection = psycopg2.connect("host=localhost port=5432 dbname=cremi user=postgres password=Audierne")
cur = connection.cursor()
def affiche_html(titre_question, question, fich... | true | true |
f707ef923ffadab284cc2684037cfd93b6bc232f | 18,285 | py | Python | lib/doFormatCheckDIF.py | joser1945/cmr-metadata-review | df0bb24dd06f981af907569f1a97966753053a99 | [
"Apache-2.0"
] | 15 | 2018-06-26T19:58:44.000Z | 2022-03-01T21:19:34.000Z | lib/doFormatCheckDIF.py | joser1945/cmr-metadata-review | df0bb24dd06f981af907569f1a97966753053a99 | [
"Apache-2.0"
] | 61 | 2018-06-27T15:15:41.000Z | 2022-03-08T15:39:32.000Z | lib/doFormatCheckDIF.py | vbjayanti/cmr-metadata-review | 1c7ac12ef26f144289e3004588a2e2b305d4f940 | [
"Apache-2.0"
] | 9 | 2019-01-22T15:48:48.000Z | 2021-10-01T18:38:30.000Z | '''
Copyright 2016, United States Government, as represented by the Administrator of
the National Aeronautics and Space Administration. All rights reserved.
The "pyCMR" platform is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may ... | 122.718121 | 9,943 | 0.762811 |
import os, errno
import json
import CollectionCheckerDIF
from cmr import searchCollection
from xml.etree import ElementTree
from xmlParser import XmlDictConfigDIF
from xmlParser import XmlDictConfig
collection_output_header = 'DIF10 Collection Elements,\
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\
,,,,,,,,,,,,,,,,,,,... | true | true |
f707eff3e3f76431a210c5b3441c3dfca87b5471 | 3,463 | py | Python | code/storyboard.py | athna/cytrone | b37c8f249d27c786028595493887f9f0ecbeae39 | [
"BSD-3-Clause"
] | 1 | 2020-04-23T02:09:45.000Z | 2020-04-23T02:09:45.000Z | code/storyboard.py | LiteraryProgrammer/cytrone | 93577d13de6102a61fbc306639253250847de537 | [
"BSD-3-Clause"
] | null | null | null | code/storyboard.py | LiteraryProgrammer/cytrone | 93577d13de6102a61fbc306639253250847de537 | [
"BSD-3-Clause"
] | null | null | null |
#############################################################################
# Classes related to the CyTrONE storyboard
#############################################################################
class Storyboard:
# Global configuration flags
ENABLE_HTTPS = True
ENABLE_PASSWORD = True
# Separato... | 47.438356 | 127 | 0.689287 | true | true | |
f707f0123f7df4e31a7504a3e66c201f5f811ebd | 3,574 | py | Python | pgAdmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete_multiple.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete_multiple.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete_multiple.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from __future__ i... | 46.415584 | 78 | 0.535534 | true | true | |
f707f1254d79d55178ea62e6f1135f1d5e0e002b | 30,174 | py | Python | discord_slash/context.py | RedstoneZockt/discord-py-interactions | 5ddbd4f303e14787e16a2c906bccd1a4e828ef6c | [
"MIT"
] | null | null | null | discord_slash/context.py | RedstoneZockt/discord-py-interactions | 5ddbd4f303e14787e16a2c906bccd1a4e828ef6c | [
"MIT"
] | null | null | null | discord_slash/context.py | RedstoneZockt/discord-py-interactions | 5ddbd4f303e14787e16a2c906bccd1a4e828ef6c | [
"MIT"
] | null | null | null | import datetime
import typing
from typing import TYPE_CHECKING
from warnings import warn
import discord
from discord.ext import commands
from discord.utils import snowflake_time
from . import error, http, model
from .dpy_overrides import ComponentMessage
if TYPE_CHECKING: # circular import sucks for typehinting
... | 39.034929 | 183 | 0.598562 | import datetime
import typing
from typing import TYPE_CHECKING
from warnings import warn
import discord
from discord.ext import commands
from discord.utils import snowflake_time
from . import error, http, model
from .dpy_overrides import ComponentMessage
if TYPE_CHECKING:
from . import client
class Interacti... | true | true |
f707f24af08406bad7adef31a302134e4dc66c93 | 6,102 | py | Python | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/utils/metrics_hook_test.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-07T18:52:33.000Z | 2019-07-06T12:48:18.000Z | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/utils/metrics_hook_test.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 63 | 2017-12-19T20:29:10.000Z | 2021-08-04T21:49:36.000Z | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/utils/metrics_hook_test.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-09T21:04:52.000Z | 2019-06-24T07:40:28.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 31.132653 | 80 | 0.683219 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import os
import shutil
from tensor2tensor.utils import metrics_hook
import tensorflow as tf
class DummyHook(metrics_hook.MetricsBasedHook):
def _process_metrics(self, gl... | true | true |
f707f2d1609dcbab7ff45a0d3a1b347d509c7995 | 41,314 | py | Python | torchbiggraph/train_cpu.py | stillmatic/PyTorch-BigGraph | d7d6576281faa54ec5850e204ffc07b1268fdb04 | [
"BSD-3-Clause"
] | 3 | 2020-09-10T15:03:20.000Z | 2020-09-13T17:38:31.000Z | torchbiggraph/train_cpu.py | stillmatic/PyTorch-BigGraph | d7d6576281faa54ec5850e204ffc07b1268fdb04 | [
"BSD-3-Clause"
] | null | null | null | torchbiggraph/train_cpu.py | stillmatic/PyTorch-BigGraph | d7d6576281faa54ec5850e204ffc07b1268fdb04 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T03:27:48.000Z | 2022-01-11T03:27:48.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE.txt file in the root directory of this source tree.
import logging
import math
import time
from collections import defaultdict
from funct... | 41.314 | 125 | 0.596819 |
import logging
import math
import time
from collections import defaultdict
from functools import partial
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple
import torch
import torch.distributed as td
from torch.optim import Optimizer
from torchbiggraph.async_adagrad import AsyncAdagra... | true | true |
f707f2e3b19fb24668146e651f30715302cff2ea | 886 | py | Python | setup.py | nurikk/icloud_photos_downloader | d159b13e43a7ad216e88e7a6aa7641cd2af5615f | [
"MIT"
] | null | null | null | setup.py | nurikk/icloud_photos_downloader | d159b13e43a7ad216e88e7a6aa7641cd2af5615f | [
"MIT"
] | null | null | null | setup.py | nurikk/icloud_photos_downloader | d159b13e43a7ad216e88e7a6aa7641cd2af5615f | [
"MIT"
] | 1 | 2019-12-22T06:14:20.000Z | 2019-12-22T06:14:20.000Z | from setuptools import setup, find_packages
with open("requirements.txt") as f:
required = f.read().splitlines()
setup(
name="icloudpd",
version="1.4.3",
url="https://github.com/ndbroadbent/icloud_photos_downloader",
description=(
"icloudpd is a command-line tool to download photos and vid... | 31.642857 | 84 | 0.65237 | from setuptools import setup, find_packages
with open("requirements.txt") as f:
required = f.read().splitlines()
setup(
name="icloudpd",
version="1.4.3",
url="https://github.com/ndbroadbent/icloud_photos_downloader",
description=(
"icloudpd is a command-line tool to download photos and vid... | true | true |
f707f2fa90d4f7a0f5673b62cd8e5c20008c595e | 1,648 | py | Python | setup.py | jeffshurtliff/khorosjx | 1530fad25eb8ccefcbb5a9ae63c09a6858cb033d | [
"MIT"
] | 2 | 2019-11-18T03:52:51.000Z | 2020-12-30T04:08:06.000Z | setup.py | jeffshurtliff/khorosjx | 1530fad25eb8ccefcbb5a9ae63c09a6858cb033d | [
"MIT"
] | 2 | 2019-12-17T17:02:30.000Z | 2021-06-02T13:56:02.000Z | setup.py | jeffshurtliff/khorosjx | 1530fad25eb8ccefcbb5a9ae63c09a6858cb033d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import setuptools
import khorosjx.utils.version
with open("README.md", "r") as fh:
long_description = fh.read()
version = khorosjx.utils.version.__version__
setuptools.setup(
name="khorosjx",
version=version,
author="Jeff Shurtliff",
author_email="jeff.shurtliff@rsa.com"... | 34.333333 | 118 | 0.62682 |
import setuptools
import khorosjx.utils.version
with open("README.md", "r") as fh:
long_description = fh.read()
version = khorosjx.utils.version.__version__
setuptools.setup(
name="khorosjx",
version=version,
author="Jeff Shurtliff",
author_email="jeff.shurtliff@rsa.com",
description="Usef... | true | true |
f707f3249684f30c3709d6e9af33fad130dcc728 | 3,698 | py | Python | allennlp/data/dataset_readers/babi.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2021-04-27T19:56:28.000Z | 2021-08-19T05:34:37.000Z | allennlp/data/dataset_readers/babi.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 5 | 2021-05-03T14:40:33.000Z | 2021-05-03T14:40:34.000Z | allennlp/data/dataset_readers/babi.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2019-12-21T05:58:44.000Z | 2021-08-16T07:41:21.000Z | import logging
from typing import Dict, List
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.instance import Instance
from allennlp.data.fields import Field, TextField, ListField, IndexField
fr... | 35.219048 | 103 | 0.626555 | import logging
from typing import Dict, List
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.instance import Instance
from allennlp.data.fields import Field, TextField, ListField, IndexField
fr... | true | true |
f707f42d22b005e6e216b1e9374ce2cbe6b88023 | 3,685 | py | Python | lib/scrapy/http/response/text.py | langzeyu/book-crawler | e2d96648384658c7775bd02d94eab086c9ece677 | [
"MIT"
] | 5 | 2019-04-02T05:00:03.000Z | 2021-04-21T11:03:50.000Z | lib/scrapy/http/response/text.py | langzeyu/book-crawler | e2d96648384658c7775bd02d94eab086c9ece677 | [
"MIT"
] | null | null | null | lib/scrapy/http/response/text.py | langzeyu/book-crawler | e2d96648384658c7775bd02d94eab086c9ece677 | [
"MIT"
] | null | null | null | """
This module implements the TextResponse class which adds encoding handling and
discovering (through HTTP headers) to base Response class.
See documentation in docs/topics/request-response.rst
"""
import re
import codecs
from scrapy.xlib.BeautifulSoup import UnicodeDammit
from scrapy.http.response import Response
... | 34.764151 | 84 | 0.646404 |
import re
import codecs
from scrapy.xlib.BeautifulSoup import UnicodeDammit
from scrapy.http.response import Response
from scrapy.utils.python import memoizemethod_noargs
from scrapy.utils.encoding import encoding_exists, resolve_encoding
from scrapy.conf import settings
# bad utf-8 encoded strings. see http://bugs... | true | true |
f707f7ff5b358bb0c46615922c3a1238ed20d144 | 11,394 | py | Python | qlib/strategy/base.py | goodchinas/qlib | d01de411a879dc98dfa7eab4da41d52b903f466c | [
"MIT"
] | null | null | null | qlib/strategy/base.py | goodchinas/qlib | d01de411a879dc98dfa7eab4da41d52b903f466c | [
"MIT"
] | null | null | null | qlib/strategy/base.py | goodchinas/qlib | d01de411a879dc98dfa7eab4da41d52b903f466c | [
"MIT"
] | 1 | 2021-11-04T09:24:45.000Z | 2021-11-04T09:24:45.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from qlib.backtest.exchange import Exchange
from qlib.backtest.position import BasePosition
from typing import List, Tuple, Union
from ..model.base imp... | 39.289655 | 143 | 0.669124 |
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from qlib.backtest.exchange import Exchange
from qlib.backtest.position import BasePosition
from typing import List, Tuple, Union
from ..model.base import BaseModel
from ..data.dataset import DatasetH
from ..data.dataset.u... | true | true |
f707f9f5620e2e46442586433401d453c0cdd2a0 | 26,593 | py | Python | tensorflow/python/ops/ragged/ragged_getitem_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 7 | 2022-03-04T21:14:47.000Z | 2022-03-22T23:07:39.000Z | tensorflow/python/ops/ragged/ragged_getitem_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 19 | 2021-12-28T12:44:55.000Z | 2022-01-13T08:11:28.000Z | tensorflow/python/ops/ragged/ragged_getitem_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 1 | 2021-11-21T02:32:27.000Z | 2021-11-21T02:32:27.000Z | # Copyright 2018 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... | 45.303237 | 84 | 0.63167 |
import re
from absl.testing import parameterized
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import test_util
from tensorflo... | true | true |
f707fb38fc701fe6ce1b8c40b3ffe14b403435a4 | 3,901 | py | Python | tests/test_ucuenca.py | stsewd/ucuenca.py | 1c74dbc9ec133dbcaa2967004e7fc9e4cf12feb5 | [
"MIT"
] | 3 | 2017-06-13T03:23:59.000Z | 2019-02-22T05:18:57.000Z | tests/test_ucuenca.py | stsewd/ucuenca.py | 1c74dbc9ec133dbcaa2967004e7fc9e4cf12feb5 | [
"MIT"
] | 6 | 2017-01-09T20:00:51.000Z | 2017-03-23T05:25:44.000Z | tests/test_ucuenca.py | stsewd/ucuenca.py | 1c74dbc9ec133dbcaa2967004e7fc9e4cf12feb5 | [
"MIT"
] | 2 | 2018-03-06T03:25:57.000Z | 2019-03-14T21:53:44.000Z | import unittest
import json
import os
from ucuenca.ucuenca import Ucuenca
TEST_RESOURCES = os.path.join(
os.path.dirname(__file__),
"..", "tests_resources"
)
class GetCareersTests(unittest.TestCase):
def setUp(self):
self.ucuenca = Ucuenca()
def test_careers(self):
"""Check 0104926... | 30.24031 | 77 | 0.651115 | import unittest
import json
import os
from ucuenca.ucuenca import Ucuenca
TEST_RESOURCES = os.path.join(
os.path.dirname(__file__),
"..", "tests_resources"
)
class GetCareersTests(unittest.TestCase):
def setUp(self):
self.ucuenca = Ucuenca()
def test_careers(self):
student_id = '01... | true | true |
f707fb42cf5a2edc45e9a23382387f7ca9663d6c | 577 | py | Python | oops_fhir/r4/value_set/common_ucumcodes_for_age.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/common_ucumcodes_for_age.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/common_ucumcodes_for_age.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
__all__ = ["CommonUCUMCodesForAge"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class CommonUCUMCodesForAge(ValueSet):
"""
Common UCUM Codes for Age
Unifi... | 19.233333 | 73 | 0.712305 | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
__all__ = ["CommonUCUMCodesForAge"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class CommonUCUMCodesForAge(ValueSet):
pass
class Meta:
resource... | true | true |
f707fc86a94333cce79cba21f503b205a669be39 | 4,171 | py | Python | Incident-Response/Tools/grr/grr/core/grr_response_core/lib/parsers/__init__.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/grr/grr/core/grr_response_core/lib/parsers/__init__.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/grr/grr/core/grr_response_core/lib/parsers/__init__.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | #!/usr/bin/env python
"""Generic parsers (for GRR server and client code)."""
from typing import Iterator
from typing import Text
from typing import Type
from typing import TypeVar
from grr_response_core.lib import factory
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.parsers import abstract
fr... | 35.649573 | 80 | 0.771997 |
from typing import Iterator
from typing import Text
from typing import Type
from typing import TypeVar
from grr_response_core.lib import factory
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.parsers import abstract
from grr_response_core.lib.util import collection
from grr_response_core.lib.ut... | true | true |
f707fcc55aa082ff4a710a1c92b8613d1ec4a4b8 | 464 | py | Python | utils/message_cooldown.py | Chr1sDev/Bloo | 3e580c06c415f949997a1b6417308aa93543d64b | [
"MIT"
] | 34 | 2021-10-30T16:48:28.000Z | 2022-03-25T03:22:12.000Z | utils/message_cooldown.py | Chr1sDev/Bloo | 3e580c06c415f949997a1b6417308aa93543d64b | [
"MIT"
] | 9 | 2021-11-19T04:25:29.000Z | 2022-03-09T22:35:46.000Z | utils/message_cooldown.py | Chr1sDev/Bloo | 3e580c06c415f949997a1b6417308aa93543d64b | [
"MIT"
] | 20 | 2021-11-05T21:14:59.000Z | 2022-03-30T21:15:40.000Z | from discord.ext import commands
"""
A custom Cooldown type subclassing built in cooldowns from discord.ext commands.
This is a bucket type that allows cooldowns to work based on some text, allowing
things like cooldown on individual `Tags`, or message spam detection.
"""
class MessageTextBucket(commands.BucketType):... | 27.294118 | 80 | 0.711207 | from discord.ext import commands
class MessageTextBucket(commands.BucketType):
custom = 7
def get_key(self, text):
return text
def __call__(self, msg):
return self.get_key(msg)
| true | true |
f707fcd87d09d2e1a64f0ee2d3b03762ada6274b | 243 | py | Python | leetCode/algorithms/easy/find_greatest_common_divisor_of_array.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 25 | 2015-01-21T16:39:18.000Z | 2021-05-24T07:01:24.000Z | leetCode/algorithms/easy/find_greatest_common_divisor_of_array.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 2 | 2020-09-30T19:39:36.000Z | 2020-10-01T17:15:16.000Z | leetCode/algorithms/easy/find_greatest_common_divisor_of_array.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 15 | 2015-01-21T16:39:27.000Z | 2020-10-01T17:00:22.000Z | from typing import List
class Solution:
def findGCD(self, nums: List[int]) -> int:
a, b = min(nums), max(nums)
for i in range(a, 1, -1):
if b % i == 0 and a % i == 0:
return i
return 1
| 22.090909 | 46 | 0.477366 | from typing import List
class Solution:
def findGCD(self, nums: List[int]) -> int:
a, b = min(nums), max(nums)
for i in range(a, 1, -1):
if b % i == 0 and a % i == 0:
return i
return 1
| true | true |
f707fcf120b0aa566709b4090ad0439dfca5c5d7 | 3,940 | py | Python | cs15211/InsertintoaBinarySearchTree.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2021-07-05T01:53:30.000Z | 2021-07-05T01:53:30.000Z | cs15211/InsertintoaBinarySearchTree.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | null | null | null | cs15211/InsertintoaBinarySearchTree.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2018-01-08T07:14:08.000Z | 2018-01-08T07:14:08.000Z | __source__ = 'https://leetcode.com/problems/insert-into-a-binary-search-tree/'
# Time: O(h) h: height of the tree
# Space: O(h)
#
# Description: Leetcode # 701. Insert into a Binary Search Tree
#
# Given the root node of a binary search tree (BST) and a value to be inserted into the tree,
# insert the value into the B... | 25.584416 | 93 | 0.555838 | __source__ = 'https://leetcode.com/problems/insert-into-a-binary-search-tree/'
ort unittest
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def insertIntoBST(self, root, val):
if not root:
r... | true | true |
f707fdcef8fbf5d9da0777b3f6d831fb0715ffb7 | 909 | py | Python | run.py | dipans/case-service | 65c8514c344dff895daf41298f0225837e6c3207 | [
"MIT"
] | null | null | null | run.py | dipans/case-service | 65c8514c344dff895daf41298f0225837e6c3207 | [
"MIT"
] | null | null | null | run.py | dipans/case-service | 65c8514c344dff895daf41298f0225837e6c3207 | [
"MIT"
] | null | null | null | from flask import Flask, json
import logging
def log_exception(sender, exception, **extra):
sender.logger.debug('Got exception during processing: %s', exception)
def create_app(config_file):
#Instantiating Flask and appling config
app = Flask(__name__)
app.config.from_object(config_file)
from ap... | 24.567568 | 73 | 0.645765 | from flask import Flask, json
import logging
def log_exception(sender, exception, **extra):
sender.logger.debug('Got exception during processing: %s', exception)
def create_app(config_file):
app = Flask(__name__)
app.config.from_object(config_file)
from app import api_bp
app.register_bluepr... | true | true |
f707ff9314e132e4d7436906b76792c00a7e668a | 2,245 | py | Python | examples/tf/trpo_cubecrash.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | 2 | 2021-02-07T12:14:52.000Z | 2021-07-29T08:07:22.000Z | examples/tf/trpo_cubecrash.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | examples/tf/trpo_cubecrash.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""This is an example to train a task with TRPO algorithm.
Here it runs CubeCrash-v0 environment with 100 iterations.
"""
import click
import gym
from metarl import wrap_experiment
from metarl.envs import MetaRLEnv, normalize
from metarl.experiment import LocalTFRunner
from metarl.experiment.de... | 35.078125 | 75 | 0.575056 |
import click
import gym
from metarl import wrap_experiment
from metarl.envs import MetaRLEnv, normalize
from metarl.experiment import LocalTFRunner
from metarl.experiment.deterministic import set_seed
from metarl.tf.algos import TRPO
from metarl.tf.baselines import GaussianCNNBaseline
from metarl.tf.policies import C... | true | true |
f708019880f311a66cf3983cc6ca3b09d0e8303c | 4,562 | py | Python | mpld3/utils.py | fdeheeger/mpld3 | c1b7fb0e3a2b0e3fd061f976c0fd19435028e611 | [
"BSD-3-Clause"
] | 2 | 2021-08-04T08:00:34.000Z | 2021-08-04T08:00:35.000Z | mpld3/utils.py | boris-arzur/mpld3 | e28a87210f974ca0659aaafa38af9f01596daa22 | [
"BSD-3-Clause"
] | null | null | null | mpld3/utils.py | boris-arzur/mpld3 | e28a87210f974ca0659aaafa38af9f01596daa22 | [
"BSD-3-Clause"
] | 1 | 2020-06-15T12:53:39.000Z | 2020-06-15T12:53:39.000Z | """
mpld3 Utilities
===============
Utility routines for the mpld3 package
"""
import os
import re
import shutil
import warnings
from functools import wraps
from . import urls
# Make sure that DeprecationWarning gets printed
warnings.simplefilter("always", DeprecationWarning)
def html_id_ok(objid, html5=False):
... | 31.680556 | 79 | 0.612889 |
import os
import re
import shutil
import warnings
from functools import wraps
from . import urls
warnings.simplefilter("always", DeprecationWarning)
def html_id_ok(objid, html5=False):
if html5:
return not re.search('\s', objid)
else:
return bool(re.match("^[a-zA-Z][a-zA-Z0-9\-\.\:\_]*$", o... | true | true |
f7080296db42b6afe1d58bb05fa41a87097d1b7a | 6,495 | py | Python | examples/v1alpha3/nas/darts-cnn-cifar10/model.py | ChenjunZou/katib | 6a07daae796c29d24f63375cce71b75c4eee8d9c | [
"Apache-2.0"
] | null | null | null | examples/v1alpha3/nas/darts-cnn-cifar10/model.py | ChenjunZou/katib | 6a07daae796c29d24f63375cce71b75c4eee8d9c | [
"Apache-2.0"
] | null | null | null | examples/v1alpha3/nas/darts-cnn-cifar10/model.py | ChenjunZou/katib | 6a07daae796c29d24f63375cce71b75c4eee8d9c | [
"Apache-2.0"
] | 2 | 2020-03-03T06:15:14.000Z | 2020-03-31T05:39:05.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import FactorizedReduce, StdConv, MixedOp
class Cell(nn.Module):
""" Cell for search
Each edge is mixed and continuous relaxed.
"""
def __init__(self, num_nodes, c_prev_prev, c_prev, c_cur, reduction_prev, reduction_cu... | 35.686813 | 112 | 0.602771 | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import FactorizedReduce, StdConv, MixedOp
class Cell(nn.Module):
def __init__(self, num_nodes, c_prev_prev, c_prev, c_cur, reduction_prev, reduction_cur, search_space):
super(Cell, self).__init__()
self.reduction_... | true | true |
f70802eb0367315e5902b750a11bf191194df1bf | 41 | py | Python | tools/uniqprimer/uniqprimer/test.py | InternationalRiceResearchInstitute/RiceGalaxy | 35083ed17d59ae91e622613587228d3f7ae7d794 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | tools/uniqprimer/uniqprimer/test.py | InternationalRiceResearchInstitute/RiceGalaxy | 35083ed17d59ae91e622613587228d3f7ae7d794 | [
"CC-BY-3.0"
] | null | null | null | tools/uniqprimer/uniqprimer/test.py | InternationalRiceResearchInstitute/RiceGalaxy | 35083ed17d59ae91e622613587228d3f7ae7d794 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | #!/usr/bin/python
from Bio import SeqIO
| 10.25 | 21 | 0.731707 |
from Bio import SeqIO
| true | true |
f708035a79355897d18599363f3ee63ca5175dac | 6,103 | py | Python | tests/test_networkx.py | enourbakhsh/skylink | 83270f3351ff637abeb0af25786412d4dd09134a | [
"MIT"
] | null | null | null | tests/test_networkx.py | enourbakhsh/skylink | 83270f3351ff637abeb0af25786412d4dd09134a | [
"MIT"
] | null | null | null | tests/test_networkx.py | enourbakhsh/skylink | 83270f3351ff637abeb0af25786412d4dd09134a | [
"MIT"
] | null | null | null | import os
import skylink
from skylink import testing
import numpy as np
from astropy.table import Table
import FoFCatalogMatching
import pytest # noqa
# TODO: test the matching with more than two catalogs
# TODO: test N-way matching with `linking_lengths` as a dictionary
# TODO: test if we catch illegal footprints th... | 30.212871 | 106 | 0.677372 | import os
import skylink
from skylink import testing
import numpy as np
from astropy.table import Table
import FoFCatalogMatching
import pytest
graph_lib = "networkx"
ncpus_max = os.cpu_count()
linking_lengths_default = 0.75
n = 2_000
def make_mockup():
def tnormal(mu=None, sigma=None, n=None, lowe... | true | true |
f70803ffb59c53fef789cee13dc4890da0d7e084 | 2,527 | py | Python | common_parser.py | jackalhan/tf_autoencoder_local | 57212dd64e53ac51dc0d14a9a9480905ebf537c0 | [
"Apache-2.0"
] | null | null | null | common_parser.py | jackalhan/tf_autoencoder_local | 57212dd64e53ac51dc0d14a9a9480905ebf537c0 | [
"Apache-2.0"
] | null | null | null | common_parser.py | jackalhan/tf_autoencoder_local | 57212dd64e53ac51dc0d14a9a9480905ebf537c0 | [
"Apache-2.0"
] | null | null | null | import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'--model_dir', default='./text_training',
help='Output directory for model and training stats.')
parser.add_argument(
'--data_dir', default='./text_data',
help='Directory to download the... | 42.830508 | 96 | 0.647408 | import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'--model_dir', default='./text_training',
help='Output directory for model and training stats.')
parser.add_argument(
'--data_dir', default='./text_data',
help='Directory to download the... | true | true |
f708049ab33a4320070c1cc6272ae9571f5d8f8f | 2,269 | py | Python | tests/dualtor/conftest.py | saravanansv/sonic-mgmt | 677fc0cb2722dba43606957fae75d1cdf852bed7 | [
"Apache-2.0"
] | null | null | null | tests/dualtor/conftest.py | saravanansv/sonic-mgmt | 677fc0cb2722dba43606957fae75d1cdf852bed7 | [
"Apache-2.0"
] | null | null | null | tests/dualtor/conftest.py | saravanansv/sonic-mgmt | 677fc0cb2722dba43606957fae75d1cdf852bed7 | [
"Apache-2.0"
] | null | null | null | import pytest
import logging
import time
from tests.common.dualtor.dual_tor_utils import get_crm_nexthop_counter # lgtm[py/unused-import]
from tests.common.helpers.assertions import pytest_assert as py_assert
from tests.common.fixtures.ptfhost_utils import change_mac_addresses, run_garp_service
CRM_POLL_INTERVAL = 1... | 35.453125 | 97 | 0.74394 | import pytest
import logging
import time
from tests.common.dualtor.dual_tor_utils import get_crm_nexthop_counter
from tests.common.helpers.assertions import pytest_assert as py_assert
from tests.common.fixtures.ptfhost_utils import change_mac_addresses, run_garp_service
CRM_POLL_INTERVAL = 1
CRM_DEFAULT_POLL_INTERV... | true | true |
f708051a44eab9b8ed607d9c993ed299aa963e52 | 351 | py | Python | fable/fable_sources/libtbx/command_line/clear_paths.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 4 | 2016-09-30T15:03:39.000Z | 2021-03-25T13:27:08.000Z | fable/fable_sources/libtbx/command_line/clear_paths.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 1 | 2018-04-18T14:41:18.000Z | 2018-04-20T19:33:52.000Z | fable/fable_sources/libtbx/command_line/clear_paths.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 3 | 2016-04-19T18:20:30.000Z | 2019-04-03T14:54:29.000Z | from __future__ import division
from libtbx.clear_paths \
import remove_or_rename_files_and_directories_if_possible
import sys
def run(args):
remaining = remove_or_rename_files_and_directories_if_possible(paths=args)
for path in remaining:
"WARNING: unable to remove or rename:", path
if (__name__ == "__main... | 27 | 76 | 0.786325 | from __future__ import division
from libtbx.clear_paths \
import remove_or_rename_files_and_directories_if_possible
import sys
def run(args):
remaining = remove_or_rename_files_and_directories_if_possible(paths=args)
for path in remaining:
"WARNING: unable to remove or rename:", path
if (__name__ == "__main... | true | true |
f70807754f550c96b6d126376377ea2da89993a5 | 678 | py | Python | app/bank/urls.py | salmanAndroidDev/digify-task | f80f1707f973b92efe6fc34d0f5bcf73b41eda36 | [
"MIT"
] | null | null | null | app/bank/urls.py | salmanAndroidDev/digify-task | f80f1707f973b92efe6fc34d0f5bcf73b41eda36 | [
"MIT"
] | null | null | null | app/bank/urls.py | salmanAndroidDev/digify-task | f80f1707f973b92efe6fc34d0f5bcf73b41eda36 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('open-account/',
views.OpenAccountAPIView.as_view(),
name='open_account'),
path('delete-account/<pk>/',
views.DeleteAccountAPIView.as_view(),
name='delete_account'),
path('deposit/<pk>/',
vi... | 22.6 | 46 | 0.589971 | from django.urls import path
from . import views
urlpatterns = [
path('open-account/',
views.OpenAccountAPIView.as_view(),
name='open_account'),
path('delete-account/<pk>/',
views.DeleteAccountAPIView.as_view(),
name='delete_account'),
path('deposit/<pk>/',
vi... | true | true |
f70808e06acf6eb0d1977a072b76ca3f1f62fd15 | 4,797 | py | Python | walk_though(Run this one).py | GoreNetwork/What-s-attached-to-switch-walk-though | e592b0f467b0a3d05bc1df9c5f884bde31c1c8de | [
"Apache-2.0"
] | 1 | 2018-03-28T21:13:40.000Z | 2018-03-28T21:13:40.000Z | walk_though(Run this one).py | GoreNetwork/What-s-attached-to-switch-walk-though | e592b0f467b0a3d05bc1df9c5f884bde31c1c8de | [
"Apache-2.0"
] | null | null | null | walk_though(Run this one).py | GoreNetwork/What-s-attached-to-switch-walk-though | e592b0f467b0a3d05bc1df9c5f884bde31c1c8de | [
"Apache-2.0"
] | null | null | null | #from excel_work import*
from common_functions import *
from pull import *
#from mac_and_arp_work import *
from napalm import get_network_driver
from getpass import getpass
from pprint import pprint
from name_work import *
import openpyxl
from openpyxl import Workbook
from openpyxl.compat import range
fro... | 27.411429 | 166 | 0.691057 |
from common_functions import *
from pull import *
from napalm import get_network_driver
from getpass import getpass
from pprint import pprint
from name_work import *
import openpyxl
from openpyxl import Workbook
from openpyxl.compat import range
from openpyxl.utils import get_column_letter
def write_ex... | true | true |
f70809961ec15ad12717baef40cb3cd51be1420e | 18,949 | py | Python | tastypie/test.py | mthornhill/django-tastypie | a3783a584e3853513746c65c012fa2d1369b8fd3 | [
"BSD-3-Clause"
] | null | null | null | tastypie/test.py | mthornhill/django-tastypie | a3783a584e3853513746c65c012fa2d1369b8fd3 | [
"BSD-3-Clause"
] | null | null | null | tastypie/test.py | mthornhill/django-tastypie | a3783a584e3853513746c65c012fa2d1369b8fd3 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import time
from django.conf import settings
from django.test import TestCase
from django.test.client import FakePayload, Client
from django.utils.encoding import force_text
from tastypie.serializers import Serializer
try:
from urllib.parse import urlparse
except ImportErr... | 35.888258 | 150 | 0.608845 | from __future__ import unicode_literals
import time
from django.conf import settings
from django.test import TestCase
from django.test.client import FakePayload, Client
from django.utils.encoding import force_text
from tastypie.serializers import Serializer
try:
from urllib.parse import urlparse
except ImportErr... | true | true |
f7080b1b05bc9b4df0a3a79e8b0eb0dbc73a0cf1 | 78 | py | Python | fedml_core/distributed/communication/mqtt/__init__.py | Alex-Roudjiat/Federated-ML-AI-Federated-ML- | 8ccc24cf2c01b868988f5d5bd65f1666cf5526bc | [
"Apache-2.0"
] | 1,120 | 2020-07-22T02:30:52.000Z | 2022-03-31T08:10:44.000Z | fedml_core/distributed/communication/mqtt/__init__.py | Alex-Roudjiat/Federated-ML-AI-Federated-ML- | 8ccc24cf2c01b868988f5d5bd65f1666cf5526bc | [
"Apache-2.0"
] | 113 | 2020-07-27T03:48:09.000Z | 2022-03-30T03:25:56.000Z | fedml_core/distributed/communication/mqtt/__init__.py | Alex-Roudjiat/Federated-ML-AI-Federated-ML- | 8ccc24cf2c01b868988f5d5bd65f1666cf5526bc | [
"Apache-2.0"
] | 381 | 2020-07-22T06:12:57.000Z | 2022-03-30T18:38:35.000Z | __all__ = ['MqttCommManager']
from .mqtt_comm_manager import MqttCommManager
| 19.5 | 46 | 0.820513 | __all__ = ['MqttCommManager']
from .mqtt_comm_manager import MqttCommManager
| true | true |
f7080bda87962f392c237b1d02e4098153d22ac8 | 17,856 | py | Python | tests/rest/admin/test_device.py | mlakkadshaw/synapse | 74a2365bd5066955567cc551e72632d6cece94b9 | [
"Apache-2.0"
] | 9,945 | 2015-01-02T07:41:06.000Z | 2022-03-31T23:22:42.000Z | tests/rest/admin/test_device.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 9,320 | 2015-01-08T14:09:03.000Z | 2022-03-31T21:11:24.000Z | tests/rest/admin/test_device.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 2,299 | 2015-01-31T22:16:29.000Z | 2022-03-31T06:08:26.000Z | # Copyright 2020 Dirk Klimpel
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 33.066667 | 114 | 0.613295 |
import urllib.parse
from http import HTTPStatus
from parameterized import parameterized
from twisted.test.proto_helpers import MemoryReactor
import synapse.rest.admin
from synapse.api.errors import Codes
from synapse.rest.client import login
from synapse.server import HomeServer
from synapse.util import... | true | true |
f7080bfceabcc1942419df8b4bafac017707b78d | 21,935 | py | Python | pysc2/lib/features_test.py | radiantprism/StarCraft-2 | 1f159ae84feaed17c5e0bd70e272c06992ae0c48 | [
"Apache-2.0"
] | 8,095 | 2017-08-09T17:28:48.000Z | 2022-03-31T00:19:45.000Z | pysc2/lib/features_test.py | radiantprism/StarCraft-2 | 1f159ae84feaed17c5e0bd70e272c06992ae0c48 | [
"Apache-2.0"
] | 328 | 2017-08-09T20:10:20.000Z | 2022-03-29T05:04:37.000Z | pysc2/lib/features_test.py | radiantprism/StarCraft-2 | 1f159ae84feaed17c5e0bd70e272c06992ae0c48 | [
"Apache-2.0"
] | 1,391 | 2017-08-09T18:46:20.000Z | 2022-03-18T07:46:23.000Z | #!/usr/bin/python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 36.742044 | 115 | 0.716389 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import pickle
from absl.testing import absltest
from absl.testing import parameterized
from future.builtins import range
import numpy
import six
from pysc2.lib import actions
from ... | true | true |
f7080c518ae1fc47e5711644e4f224ee3c1b2c7f | 1,116 | py | Python | setup.py | timgates42/kivy-ios | 132eb2739279c479556e74575b97ba9df8faf046 | [
"MIT"
] | null | null | null | setup.py | timgates42/kivy-ios | 132eb2739279c479556e74575b97ba9df8faf046 | [
"MIT"
] | null | null | null | setup.py | timgates42/kivy-ios | 132eb2739279c479556e74575b97ba9df8faf046 | [
"MIT"
] | null | null | null | import os
from glob import glob
from setuptools import setup, find_packages
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
def recursive_include(module):
module_path = module.replace(".", "/") + "/"
files = glob(f"{module_path}**", recursive=True... | 31 | 82 | 0.671147 | import os
from glob import glob
from setuptools import setup, find_packages
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
def recursive_include(module):
module_path = module.replace(".", "/") + "/"
files = glob(f"{module_path}**", recursive=True... | true | true |
f7080d396c4f1a78d80c63ef4098a0c25063085e | 114 | py | Python | srptools/exceptions.py | idlesign/srptools | 35dd4a355e0723cdc1252eb346cff69b9073711d | [
"BSD-3-Clause"
] | 20 | 2017-02-13T15:16:18.000Z | 2022-01-27T15:49:06.000Z | srptools/exceptions.py | idlesign/srptools | 35dd4a355e0723cdc1252eb346cff69b9073711d | [
"BSD-3-Clause"
] | 10 | 2017-03-05T15:09:49.000Z | 2022-01-28T05:44:45.000Z | srptools/exceptions.py | idlesign/srptools | 35dd4a355e0723cdc1252eb346cff69b9073711d | [
"BSD-3-Clause"
] | 7 | 2017-03-11T07:50:09.000Z | 2021-12-16T11:59:00.000Z | from __future__ import unicode_literals
class SRPException(Exception):
"""Base srptools exception class."""
| 19 | 40 | 0.77193 | from __future__ import unicode_literals
class SRPException(Exception):
| true | true |
f7080e2cbbea07d976c6f91d6794ea06cc485769 | 817 | py | Python | examples/wrap_pytorch.py | ccoulombe/thinc | 8d891b61ddef3ca00266ca0ec7c47e2d063a3a83 | [
"MIT"
] | null | null | null | examples/wrap_pytorch.py | ccoulombe/thinc | 8d891b61ddef3ca00266ca0ec7c47e2d063a3a83 | [
"MIT"
] | null | null | null | examples/wrap_pytorch.py | ccoulombe/thinc | 8d891b61ddef3ca00266ca0ec7c47e2d063a3a83 | [
"MIT"
] | null | null | null | import plac
import numpy
import torch
from torch import autograd
from torch import nn
import torch.optim
import torch.cuda
from thinc.neural.ops import CupyOps
from thinc.extra.wrappers import PyTorchWrapper
from thinc.v2v import Model
def main(length=1000, nO=32, nI=32):
if CupyOps.xp != None:
print("U... | 22.081081 | 63 | 0.656059 | import plac
import numpy
import torch
from torch import autograd
from torch import nn
import torch.optim
import torch.cuda
from thinc.neural.ops import CupyOps
from thinc.extra.wrappers import PyTorchWrapper
from thinc.v2v import Model
def main(length=1000, nO=32, nI=32):
if CupyOps.xp != None:
print("U... | true | true |
f7080e67524a51871c0f56f0d55f2da7a6eaf532 | 4,542 | py | Python | app/common/views.py | vigov5/oshougatsu2015 | 38cbf325675ee2c08a6965b8689fad8308eb84eb | [
"MIT"
] | null | null | null | app/common/views.py | vigov5/oshougatsu2015 | 38cbf325675ee2c08a6965b8689fad8308eb84eb | [
"MIT"
] | null | null | null | app/common/views.py | vigov5/oshougatsu2015 | 38cbf325675ee2c08a6965b8689fad8308eb84eb | [
"MIT"
] | null | null | null | from flask import render_template, g, request, url_for, jsonify, redirect
from flask_login import current_user, login_required
import flask_menu as menu
from sqlalchemy import desc, asc
from app import app, lm
from app.user.models import User, UserJoin
from app.contest.models import Contest
from app.submission.models ... | 34.671756 | 237 | 0.6321 | from flask import render_template, g, request, url_for, jsonify, redirect
from flask_login import current_user, login_required
import flask_menu as menu
from sqlalchemy import desc, asc
from app import app, lm
from app.user.models import User, UserJoin
from app.contest.models import Contest
from app.submission.models ... | true | true |
f7080ea0135fa78c83425edc26e83fafaf4e91c6 | 2,579 | py | Python | tests/test_day_05.py | jrcoutinho/aoc-2019-python | 307ecddc0f7feeb31bc5d95a0479d5498bbf2679 | [
"MIT"
] | null | null | null | tests/test_day_05.py | jrcoutinho/aoc-2019-python | 307ecddc0f7feeb31bc5d95a0479d5498bbf2679 | [
"MIT"
] | null | null | null | tests/test_day_05.py | jrcoutinho/aoc-2019-python | 307ecddc0f7feeb31bc5d95a0479d5498bbf2679 | [
"MIT"
] | null | null | null | from aoc.day_02 import IntcodeComputer
def _run_test(program, expected):
computer = IntcodeComputer(program).execute()
assert ",".join(str(x) for x in computer.memory) == expected
def test_input(monkeypatch):
monkeypatch.setattr("builtins.input", lambda: "1")
program = "3,0,99"
expected = "1,0,... | 26.587629 | 64 | 0.666537 | from aoc.day_02 import IntcodeComputer
def _run_test(program, expected):
computer = IntcodeComputer(program).execute()
assert ",".join(str(x) for x in computer.memory) == expected
def test_input(monkeypatch):
monkeypatch.setattr("builtins.input", lambda: "1")
program = "3,0,99"
expected = "1,0,... | true | true |
f7080ea22b594eb170cc9fc284bca87deed83679 | 18,309 | py | Python | nipyapi/nifi/models/controller_status_dto.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/controller_status_dto.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/controller_status_dto.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 33.532967 | 479 | 0.655579 |
from pprint import pformat
from six import iteritems
import re
class ControllerStatusDTO(object):
swagger_types = {
'active_thread_count': 'int',
'terminated_thread_count': 'int',
'queued': 'str',
'flow_files_queued': 'int',
'bytes_queued': 'int',
'running_cou... | true | true |
f7080eaefa65d3a729296006984ef9636d09f1a7 | 4,838 | py | Python | repo/plugin.video.exodus/resources/lib/sources/mfree_mv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.exodus/resources/lib/sources/mfree_mv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.exodus/resources/lib/sources/mfree_mv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... | 34.312057 | 147 | 0.509921 |
import re,urlparse
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import cache
from resources.lib.modules import directstream
class source:
def __init__(self):
self.domains = ['m4ufree.info']
self.base_link = 'htt... | true | true |
f7080f0c7f3c31c0348f24f044d9060fdc789815 | 4,232 | py | Python | video_demo.py | mdraw/AlphaPose | bed8e0798f6deed4789b9ae2646f72b9fd138c5b | [
"Apache-2.0"
] | null | null | null | video_demo.py | mdraw/AlphaPose | bed8e0798f6deed4789b9ae2646f72b9fd138c5b | [
"Apache-2.0"
] | null | null | null | video_demo.py | mdraw/AlphaPose | bed8e0798f6deed4789b9ae2646f72b9fd138c5b | [
"Apache-2.0"
] | null | null | null | import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import torch.utils.data
import numpy as np
from opt import opt
from dataloader import VideoLoader, DetectionLoader, DetectionProcessor, DataWriter, Mscoco
from yolo.util i... | 34.406504 | 144 | 0.618384 | import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import torch.utils.data
import numpy as np
from opt import opt
from dataloader import VideoLoader, DetectionLoader, DetectionProcessor, DataWriter, Mscoco
from yolo.util i... | true | true |
f7080f3228b0020368d246c9844f3b75276a7981 | 2,368 | py | Python | tools/telemetry/telemetry/page/actions/loop_unittest.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-11-28T10:46:52.000Z | 2019-11-28T10:46:52.000Z | tools/telemetry/telemetry/page/actions/loop_unittest.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/telemetry/telemetry/page/actions/loop_unittest.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-27T11:15:39.000Z | 2016-08-17T14:19:56.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import decorators
from telemetry.core import util
from telemetry.page.actions import loop
from telemetry.unittest_util import tab_test_case
A... | 44.679245 | 78 | 0.743243 |
from telemetry import decorators
from telemetry.core import util
from telemetry.page.actions import loop
from telemetry.unittest_util import tab_test_case
AUDIO_1_LOOP_CHECK = 'window.__hasEventCompleted("#audio_1", "loop");'
VIDEO_1_LOOP_CHECK = 'window.__hasEventCompleted("#video_1", "loop");'
class LoopAction... | true | true |
f7080fb80e9aa983997b0fbf7e6f27f3d4fc213f | 3,686 | py | Python | syntax_highlighting/en/pygments/catala_en.py | xbonnetain/catala | 04604ad9d01f99fe19ffca354e2cd70ef8ab34d3 | [
"Apache-2.0"
] | null | null | null | syntax_highlighting/en/pygments/catala_en.py | xbonnetain/catala | 04604ad9d01f99fe19ffca354e2cd70ef8ab34d3 | [
"Apache-2.0"
] | null | null | null | syntax_highlighting/en/pygments/catala_en.py | xbonnetain/catala | 04604ad9d01f99fe19ffca354e2cd70ef8ab34d3 | [
"Apache-2.0"
] | null | null | null | from pygments.lexer import RegexLexer, bygroups
from pygments.token import *
import re
__all__ = ['CatalaEnLexer']
class CatalaEnLexer(RegexLexer):
name = 'CatalaEn'
aliases = ['catala_en']
filenames = ['*.catala_en']
flags = re.MULTILINE | re.UNICODE
tokens = {
'root': [
(u... | 62.474576 | 352 | 0.511394 | from pygments.lexer import RegexLexer, bygroups
from pygments.token import *
import re
__all__ = ['CatalaEnLexer']
class CatalaEnLexer(RegexLexer):
name = 'CatalaEn'
aliases = ['catala_en']
filenames = ['*.catala_en']
flags = re.MULTILINE | re.UNICODE
tokens = {
'root': [
(u... | true | true |
f7080fd2eda7217128ad61bbc427baee50aee4c9 | 292 | py | Python | ctpn/show_model.py | aiedward/OCR-1 | 82ce764fb0071917360ea8b1ec5372035d0897b5 | [
"Apache-2.0"
] | 1 | 2020-04-20T05:10:40.000Z | 2020-04-20T05:10:40.000Z | ctpn/show_model.py | aiedward/OCR-1 | 82ce764fb0071917360ea8b1ec5372035d0897b5 | [
"Apache-2.0"
] | null | null | null | ctpn/show_model.py | aiedward/OCR-1 | 82ce764fb0071917360ea8b1ec5372035d0897b5 | [
"Apache-2.0"
] | null | null | null | from tensorflow.python import pywrap_tensorflow
checkpoint_path = 'checkpoints/VGGnet_fast_rcnn_iter_50000.ckpt'
reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map = reader.get_variable_to_shape_map()
for key in var_to_shape_map:
print("tensor_name: ", key)
| 41.714286 | 64 | 0.84589 | from tensorflow.python import pywrap_tensorflow
checkpoint_path = 'checkpoints/VGGnet_fast_rcnn_iter_50000.ckpt'
reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map = reader.get_variable_to_shape_map()
for key in var_to_shape_map:
print("tensor_name: ", key)
| true | true |
f70811e4e7d8c3ad97aa34bee3b40802deccfec3 | 9,161 | py | Python | paper_material.py | hakyimlab/multixcan-paper | bafad243f42298a0973ba4d4009b2b2f783743a3 | [
"MIT"
] | null | null | null | paper_material.py | hakyimlab/multixcan-paper | bafad243f42298a0973ba4d4009b2b2f783743a3 | [
"MIT"
] | null | null | null | paper_material.py | hakyimlab/multixcan-paper | bafad243f42298a0973ba4d4009b2b2f783743a3 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import os
import subprocess
import svgwrite
import math
import shutil
########################################################################################################################
def ensure_requisite_folders(path):
folder = os.path.split(path)[0]
if len(folder) and not os.pat... | 36.353175 | 135 | 0.613688 |
import os
import subprocess
import svgwrite
import math
import shutil
ltixcan_stats.txt",),
("gwas_smultixcan_significant.txt",),
("gwas_sp_significant.txt",),
("ukb_multixcan_stats.txt",),
("ukb_p_significant.txt",),
("ukb_multixcan_sign... | true | true |
f70812d2689291dc7dd4dc7a7b5eb1aacc45c5d5 | 2,322 | py | Python | inktime/rgbkm.py | fligt/inktime | 45f20602ef07cc8f62e0192318913cf910eb925b | [
"Apache-2.0"
] | null | null | null | inktime/rgbkm.py | fligt/inktime | 45f20602ef07cc8f62e0192318913cf910eb925b | [
"Apache-2.0"
] | 3 | 2021-07-13T15:09:03.000Z | 2021-07-13T15:09:08.000Z | inktime/rgbkm.py | fligt/inktime | 45f20602ef07cc8f62e0192318913cf910eb925b | [
"Apache-2.0"
] | 1 | 2022-03-08T14:13:30.000Z | 2022-03-08T14:13:30.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/00_rgbkm.ipynb (unless otherwise specified).
__all__ = ['reflectance']
# Cell
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import cv2
import scipy.optimize as optimize
def reflectance(K, S, D, Rg):
'''Calculates reflectance ... | 27 | 113 | 0.599914 |
__all__ = ['reflectance']
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import cv2
import scipy.optimize as optimize
def reflectance(K, S, D, Rg):
Rg = np.array(Rg)
shape = Rg.shape
if len(shape) == 1:
h, w = D.shape
Rg_img = np.ones([h, w, ... | true | true |
f708134fe19c7e41a5320a642137a1f4d9644d9a | 2,766 | py | Python | assets/code/python_code/python_socket/tcp/client.py | zanghu/gitbook_notebook | 6df70f912ef16617456bd773b69240f42ee768c5 | [
"MIT"
] | 4 | 2019-01-23T02:58:56.000Z | 2019-07-19T12:40:59.000Z | assets/code/python_code/python_socket/tcp/client.py | zanghu/gitbook_notebook | 6df70f912ef16617456bd773b69240f42ee768c5 | [
"MIT"
] | null | null | null | assets/code/python_code/python_socket/tcp/client.py | zanghu/gitbook_notebook | 6df70f912ef16617456bd773b69240f42ee768c5 | [
"MIT"
] | null | null | null | #coding=utf-8
#!/bin/env python
import os
import base64
import socket
import numpy
import time
m_serv_ip = '10.230.147.31'
m_serv_port = 9999
def init_socket(serv_ip, serv_port):
""""""
ip_port = (serv_ip, serv_port)
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) # TCP
#sk = socket.socket(... | 30.065217 | 101 | 0.626537 |
import os
import base64
import socket
import numpy
import time
m_serv_ip = '10.230.147.31'
m_serv_port = 9999
def init_socket(serv_ip, serv_port):
ip_port = (serv_ip, serv_port)
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sk.connect(ip_port)
sk.settimeout(50)
return sk
def send_... | true | true |
f708138891556136d31fa1d4e8dbc351bd793c32 | 17,911 | py | Python | gpkit/constraints/sgp.py | beldonl/gpkit | 4c422d3f3b65b85f5baacc36305064aee4341ebe | [
"MIT"
] | null | null | null | gpkit/constraints/sgp.py | beldonl/gpkit | 4c422d3f3b65b85f5baacc36305064aee4341ebe | [
"MIT"
] | null | null | null | gpkit/constraints/sgp.py | beldonl/gpkit | 4c422d3f3b65b85f5baacc36305064aee4341ebe | [
"MIT"
] | null | null | null | """Implement the SequentialGeometricProgram class"""
from time import time
from collections import OrderedDict
import numpy as np
from ..exceptions import InvalidGPConstraint, Infeasible, UnnecessarySGP
from ..keydict import KeyDict
from ..nomials import Variable
from .gp import GeometricProgram
from ..nomials import P... | 46.643229 | 104 | 0.570711 | from time import time
from collections import OrderedDict
import numpy as np
from ..exceptions import InvalidGPConstraint, Infeasible, UnnecessarySGP
from ..keydict import KeyDict
from ..nomials import Variable
from .gp import GeometricProgram
from ..nomials import PosynomialInequality
from .. import NamedVariables
fro... | true | true |
f70813ab6b0a29667673f0e105ff0efc293c2861 | 7,934 | py | Python | nova/api/openstack/compute/plugins/v3/hypervisors.py | alvarolopez/nova | 97a97205a980459bae1f61aec3d4c7e0bec1e9c2 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/plugins/v3/hypervisors.py | alvarolopez/nova | 97a97205a980459bae1f61aec3d4c7e0bec1e9c2 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/plugins/v3/hypervisors.py | alvarolopez/nova | 97a97205a980459bae1f61aec3d4c7e0bec1e9c2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 38.892157 | 79 | 0.580161 |
import webob.exc
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova import exception
from nova.i18n import _
from nova import servicegroup
ALIAS = "os-hypervisors"
authorize = extensions.os_compute_authorizer(ALIAS)
class HypervisorsCont... | true | true |
f70814361a55cd2096a3f189320262ab475a1a5f | 400 | py | Python | bili_kits/api/__init__.py | LonelySteve/Bili-Kits | 42e536400b2f35d57e5871de34303b6f2fc901ed | [
"MIT"
] | null | null | null | bili_kits/api/__init__.py | LonelySteve/Bili-Kits | 42e536400b2f35d57e5871de34303b6f2fc901ed | [
"MIT"
] | null | null | null | bili_kits/api/__init__.py | LonelySteve/Bili-Kits | 42e536400b2f35d57e5871de34303b6f2fc901ed | [
"MIT"
] | null | null | null | _BASE_WWW_BILIBILI_COM="https://www.bilibili.com"
_BASE_API_BILIBILI_COM="https://api.bilibili.com"
_BASE_API_BILIBILI_COM_X="https://api.bilibili.com/x"
_BASE_API_BILIBILI_COM_X_V2="%s/v2" % _BASE_API_BILIBILI_COM_X
_BASE_WEB_INTERFACE="%s/web-interface" % _BASE_API_BILIBILI_COM_X
_BASE_API_VC_BILIBILI_COM="http://ap... | 50 | 65 | 0.835 | _BASE_WWW_BILIBILI_COM="https://www.bilibili.com"
_BASE_API_BILIBILI_COM="https://api.bilibili.com"
_BASE_API_BILIBILI_COM_X="https://api.bilibili.com/x"
_BASE_API_BILIBILI_COM_X_V2="%s/v2" % _BASE_API_BILIBILI_COM_X
_BASE_WEB_INTERFACE="%s/web-interface" % _BASE_API_BILIBILI_COM_X
_BASE_API_VC_BILIBILI_COM="http://ap... | true | true |
f70814e7ac2b17c9709ae4005bbc3581dcf38d66 | 3,008 | py | Python | Server_API/licenciement-auto.py | crozes/CST_Project | 0269be2c17da59f5b8c05671e24f7bf64c9fdea9 | [
"MIT"
] | null | null | null | Server_API/licenciement-auto.py | crozes/CST_Project | 0269be2c17da59f5b8c05671e24f7bf64c9fdea9 | [
"MIT"
] | null | null | null | Server_API/licenciement-auto.py | crozes/CST_Project | 0269be2c17da59f5b8c05671e24f7bf64c9fdea9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
from __future__ import print_function
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import json
import os
from flask import Flask
from flask import jsonify
from flask_cors import CORS
app = Flask(__name__)
#A tester
cors = ... | 31.333333 | 358 | 0.56117 |
from __future__ import print_function
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import json
import os
from flask import Flask
from flask import jsonify
from flask_cors import CORS
app = Flask(__name__)
cors = CORS(app)
SCOPES = 'https:/... | true | true |
f70815582f4c0043457ae574255b906a4b41d2d3 | 4,143 | py | Python | auto_editor/utils/progressbar.py | chancat87/auto-editor | 2dbf230ed172602e958e3b727cf5183eb48e50b3 | [
"Unlicense"
] | null | null | null | auto_editor/utils/progressbar.py | chancat87/auto-editor | 2dbf230ed172602e958e3b727cf5183eb48e50b3 | [
"Unlicense"
] | null | null | null | auto_editor/utils/progressbar.py | chancat87/auto-editor | 2dbf230ed172602e958e3b727cf5183eb48e50b3 | [
"Unlicense"
] | null | null | null | import sys
from math import floor
from time import time, localtime
from shutil import get_terminal_size
from platform import system
from typing import Union
from .func import get_stdout
class ProgressBar:
def __init__(self, bar_type: str) -> None:
self.machine = False
self.hide = False
... | 28.972028 | 95 | 0.506396 | import sys
from math import floor
from time import time, localtime
from shutil import get_terminal_size
from platform import system
from typing import Union
from .func import get_stdout
class ProgressBar:
def __init__(self, bar_type: str) -> None:
self.machine = False
self.hide = False
... | true | true |
f7081627885de99317f297375e9e2fe146b35626 | 4,125 | py | Python | lib/tests/test_config.py | mikewalch/muchos | 6e786a0f43e4be01ce15fe1bf9fc7aeafd46739f | [
"Apache-2.0"
] | null | null | null | lib/tests/test_config.py | mikewalch/muchos | 6e786a0f43e4be01ce15fe1bf9fc7aeafd46739f | [
"Apache-2.0"
] | null | null | null | lib/tests/test_config.py | mikewalch/muchos | 6e786a0f43e4be01ce15fe1bf9fc7aeafd46739f | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Muchos authors (see AUTHORS)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 57.291667 | 220 | 0.640242 |
from muchos.config import DeployConfig
def test_defaults():
c = DeployConfig("muchos", '../conf/muchos.props.example', '../conf/hosts/example/example_cluster',
'../conf/checksums', 'mycluster')
assert c.checksum_ver('accumulo', '1.9.0') == 'f68a6145029a9ea843b0305c90a7f5f033... | true | true |
f70818765316c2ec03e839fa7ce2c7c658eaa0fd | 3,946 | py | Python | src/clikit/ui/components/exception_trace.py | kevinastone/clikit | 2d9f4b4ac8cffa3229df1bb5bdd199c58ad72d5d | [
"MIT"
] | 1 | 2021-03-21T10:44:22.000Z | 2021-03-21T10:44:22.000Z | src/clikit/ui/components/exception_trace.py | kevinastone/clikit | 2d9f4b4ac8cffa3229df1bb5bdd199c58ad72d5d | [
"MIT"
] | null | null | null | src/clikit/ui/components/exception_trace.py | kevinastone/clikit | 2d9f4b4ac8cffa3229df1bb5bdd199c58ad72d5d | [
"MIT"
] | null | null | null | import ast
import inspect
import keyword
import sys
import traceback
from clikit.api.io import IO
class ExceptionTrace(object):
"""
Renders the trace of an exception.
"""
THEME = {
"comment": "<fg=black;options=bold>",
"keyword": "<fg=yellow>",
"builtin": "<fg=blue>",
... | 29.893939 | 82 | 0.547643 | import ast
import inspect
import keyword
import sys
import traceback
from clikit.api.io import IO
class ExceptionTrace(object):
THEME = {
"comment": "<fg=black;options=bold>",
"keyword": "<fg=yellow>",
"builtin": "<fg=blue>",
"literal": "<fg=magenta>",
}
AST_ELEMENTS = {... | true | true |
f7081b69da473f736356c8c9de8a9c57a7b4d90e | 399 | py | Python | lithography/wsgi.py | lwbe/lithography | 0a640a58b563647d34528c7544e0ac200cd8dd97 | [
"MIT"
] | null | null | null | lithography/wsgi.py | lwbe/lithography | 0a640a58b563647d34528c7544e0ac200cd8dd97 | [
"MIT"
] | 12 | 2020-06-05T17:26:19.000Z | 2022-03-11T23:16:21.000Z | lithography/wsgi.py | lwbe/lithography | 0a640a58b563647d34528c7544e0ac200cd8dd97 | [
"MIT"
] | null | null | null | """
WSGI config for lithography project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lithography.settings')
application = get_wsgi_application()
| true | true |
f7081cbeb9857272c5f131a50f03e9c958dae3c6 | 814 | py | Python | setup.py | jondot/dotrunner | d80a72a291a1de86626b7bfb65892f5898d8d057 | [
"BSD-2-Clause"
] | 2 | 2018-09-02T15:44:01.000Z | 2020-06-15T08:56:47.000Z | setup.py | jondot/dotrunner | d80a72a291a1de86626b7bfb65892f5898d8d057 | [
"BSD-2-Clause"
] | 3 | 2020-09-05T11:46:55.000Z | 2021-05-09T16:17:59.000Z | setup.py | jondot/dotrunner | d80a72a291a1de86626b7bfb65892f5898d8d057 | [
"BSD-2-Clause"
] | 1 | 2019-10-15T14:45:27.000Z | 2019-10-15T14:45:27.000Z | # -*- coding: utf-8 -*-
from dotrunner.version import VERSION
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='dotrunner',
version=VERSION,
description='Links dotfiles',
long_description=rea... | 26.258065 | 76 | 0.632678 |
from dotrunner.version import VERSION
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='dotrunner',
version=VERSION,
description='Links dotfiles',
long_description=readme,
author='Dotan ... | true | true |
f7081d04f130b03fc952042146402d7f447fa934 | 604 | py | Python | cuor/harvester/general.py | tocororo/cuor | 0202970f19b927562f34eb4367ea4f91e08e6706 | [
"MIT"
] | null | null | null | cuor/harvester/general.py | tocororo/cuor | 0202970f19b927562f34eb4367ea4f91e08e6706 | [
"MIT"
] | null | null | null | cuor/harvester/general.py | tocororo/cuor | 0202970f19b927562f34eb4367ea4f91e08e6706 | [
"MIT"
] | null | null | null | from cuor.organizations.api import OrganizationRecord
import traceback
def remove_nulls(d):
return {k: v for k, v in d.items() if v is not None}
def _assing_if_exist(data, record, field):
if field in record:
data[field] = record[field]
def insert_in_cuor(data, inst):
# try:
OrganizationReco... | 25.166667 | 80 | 0.587748 | from cuor.organizations.api import OrganizationRecord
import traceback
def remove_nulls(d):
return {k: v for k, v in d.items() if v is not None}
def _assing_if_exist(data, record, field):
if field in record:
data[field] = record[field]
def insert_in_cuor(data, inst):
OrganizationRecord.cre... | true | true |
f7081d5dad49cf3395526fbe0ef9fa8dc20e9ddf | 6,037 | py | Python | supyr_struct/field_type_methods/encoders.py | forksnd/supyr_struct | 7ce60c406c0755e13658ba5d19b8437ff601cf43 | [
"MIT"
] | 5 | 2020-02-15T06:19:45.000Z | 2022-01-15T20:01:02.000Z | supyr_struct/field_type_methods/encoders.py | forksnd/supyr_struct | 7ce60c406c0755e13658ba5d19b8437ff601cf43 | [
"MIT"
] | 5 | 2019-11-25T20:39:33.000Z | 2020-01-16T08:50:15.000Z | supyr_struct/field_type_methods/encoders.py | forksnd/supyr_struct | 7ce60c406c0755e13658ba5d19b8437ff601cf43 | [
"MIT"
] | 1 | 2019-09-02T06:10:40.000Z | 2019-09-02T06:10:40.000Z | '''
Encoder functions for all standard FieldTypes.
Encoders are responsible for converting a python object into bytes*
*Not all encoders return bytes objects.
FieldTypes that operate on the bit level cant be expected to return
even byte sized amounts of bits, so they operate differently.
A FieldTypes serializer and e... | 30.034826 | 80 | 0.673845 | __all__ = [
'encode_numeric', 'encode_string', 'no_encode',
'encode_big_int', 'encode_bit_int',
'encode_24bit_numeric', 'encode_decimal', 'encode_bit', 'encode_raw_string',
'encode_int_timestamp', 'encode_float_timestamp', 'encode_string_hex',
'encoder_wrapper',
]
from decimal ... | true | true |
f7081eaa121f76966dad478c0bd156dc401f5372 | 3,678 | py | Python | actions/actions.py | coreycb/charm-swift-storage | c31991ab198d7b51b9a4f5744a1fcc1fef0bc1ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | actions/actions.py | coreycb/charm-swift-storage | c31991ab198d7b51b9a4f5744a1fcc1fef0bc1ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | actions/actions.py | coreycb/charm-swift-storage | c31991ab198d7b51b9a4f5744a1fcc1fef0bc1ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 29.902439 | 79 | 0.693855 |
import argparse
import os
import sys
import yaml
from charmhelpers.core.host import service_pause, service_resume
from charmhelpers.core.hookenv import action_fail
from charmhelpers.core.unitdata import HookData, kv
from charmhelpers.contrib.openstack.utils import (
get_os_codename_package,
set... | true | true |
f7081f1ab5736a9a2db040d3dadfb73cde6fea07 | 14,065 | py | Python | Youtube Bot Client/database.py | zackmawaldi/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader | 3681babb6a46ec2e957cd57888dd13ac22b56cab | [
"MIT"
] | 279 | 2019-09-05T19:56:04.000Z | 2022-03-29T01:02:33.000Z | Youtube Bot Client/database.py | zackmawaldi/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader | 3681babb6a46ec2e957cd57888dd13ac22b56cab | [
"MIT"
] | 74 | 2019-12-18T04:23:45.000Z | 2022-03-21T19:33:51.000Z | Youtube Bot Client/database.py | zackmawaldi/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader | 3681babb6a46ec2e957cd57888dd13ac22b56cab | [
"MIT"
] | 153 | 2019-09-06T17:43:56.000Z | 2022-03-27T13:20:05.000Z | import mysql
import pickle
import hashlib
import mysql.connector
from mysql.connector import pooling
import settings
import datetime
from time import sleep
def initDatabase():
global connection_pool
connection_object = connection_pool.get_connection()
cursor = connection_object.cursor()
cu... | 36.437824 | 279 | 0.653608 | import mysql
import pickle
import hashlib
import mysql.connector
from mysql.connector import pooling
import settings
import datetime
from time import sleep
def initDatabase():
global connection_pool
connection_object = connection_pool.get_connection()
cursor = connection_object.cursor()
cu... | true | true |
f7081f1b7f9f4fdf577a65a182a30a34529ab7d2 | 1,918 | py | Python | resdiffcheck/diffcheck.py | bayotop/resdiffcheck | ff8004d424006a19c9fd75d45a621c8a63c4cd54 | [
"MIT"
] | 4 | 2018-04-30T18:33:24.000Z | 2020-04-06T14:54:55.000Z | resdiffcheck/diffcheck.py | codingo/resdiffcheck | ff8004d424006a19c9fd75d45a621c8a63c4cd54 | [
"MIT"
] | null | null | null | resdiffcheck/diffcheck.py | codingo/resdiffcheck | ff8004d424006a19c9fd75d45a621c8a63c4cd54 | [
"MIT"
] | 4 | 2017-12-11T22:09:01.000Z | 2020-05-24T21:02:19.000Z | #!/usr/bin/env python
import argparse
from datetime import date
import hashlib
import logging
import sys
import textwrap
from classes.resource import Resource
from classes.dbmanager import ResourceStorage
from classes.reporter import HtmlReport
import helpers
def get_reports_path(path):
today = date.today()
... | 30.935484 | 96 | 0.690824 |
import argparse
from datetime import date
import hashlib
import logging
import sys
import textwrap
from classes.resource import Resource
from classes.dbmanager import ResourceStorage
from classes.reporter import HtmlReport
import helpers
def get_reports_path(path):
today = date.today()
return "{0}/{1}/{2}/"... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.