hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 LoopActionTes... | 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
def ensure_requisite_folders(path):
folder = os.path.split(path)[0]
if len(folder) and not os.path.exists(folder):
os.makedirs(folder)
def _png_name(p):
return p.split(".svg")[0]+".png"
def to_png(from_path, to_path):
ensur... | 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, 3])
... | 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 HypervisorsController(wsgi.Co... | 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://www... | 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') == 'f68a6145029a9ea843b0305c90a7f5f0334d8a8ceeea947... | 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 N... | 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.crea... | 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 imp... | true | true |
f7081df4c46b5d3d2119ae7b703e101c051c0da9 | 11,955 | py | Python | lib/networks/Resnet50_test.py | joyeuxni/MIFNet | 3b1e1f56d549bb2d105e9782c2b327b2f7d7d089 | [
"MIT"
] | 1 | 2020-05-10T10:21:22.000Z | 2020-05-10T10:21:22.000Z | lib/networks/Resnet50_test.py | joyeuxni/MIFNet | 3b1e1f56d549bb2d105e9782c2b327b2f7d7d089 | [
"MIT"
] | 2 | 2020-05-10T10:28:32.000Z | 2020-06-23T08:28:25.000Z | lib/networks/Resnet50_test.py | joyeuxni/MIFNet | 3b1e1f56d549bb2d105e9782c2b327b2f7d7d089 | [
"MIT"
] | null | null | null | import tensorflow as tf
from networks.network import Network
from ..fast_rcnn.config import cfg
import pdb
n_classes = 21
_feat_stride = [16,]
anchor_scales = [2,4,8,16,32]
class Resnet50_test(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shap... | 50.65678 | 113 | 0.591803 | import tensorflow as tf
from networks.network import Network
from ..fast_rcnn.config import cfg
import pdb
n_classes = 21
_feat_stride = [16,]
anchor_scales = [2,4,8,16,32]
class Resnet50_test(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shap... | false | 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_os_workload_st... | 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 |
f7081f73c9aff0c80634d1d71479fed9e3fe62cf | 2,275 | py | Python | AppPkg/Applications/Python/Python-2.7.2/Lib/email/iterators.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | AppPkg/Applications/Python/Python-2.7.2/Lib/email/iterators.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | AppPkg/Applications/Python/Python-2.7.2/Lib/email/iterators.py | CEOALT1/RefindPlusUDK | 116b957ad735f96fbb6d80a0ba582046960ba164 | [
"BSD-2-Clause"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
# Do not include _structure() since it's part of the debuggi... | 30.743243 | 76 | 0.634286 |
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
]
import sys
from cStringIO import StringIO
# This function will become a method of the Message class
def walk(self):
yield self
if self.is_multipart():
for subpart in self.get_payload():
... | true | true |
f7081fa18c16e5bb9c85414fdde284ae2f611859 | 766 | py | Python | docs/components_page/components/popover/popover.py | imrehg/dash-bootstrap-components | 7cf43168808bb88b243e414168dc3bf196fefd84 | [
"Apache-2.0"
] | 1 | 2022-01-12T12:36:20.000Z | 2022-01-12T12:36:20.000Z | docs/components_page/components/popover/popover.py | imrehg/dash-bootstrap-components | 7cf43168808bb88b243e414168dc3bf196fefd84 | [
"Apache-2.0"
] | null | null | null | docs/components_page/components/popover/popover.py | imrehg/dash-bootstrap-components | 7cf43168808bb88b243e414168dc3bf196fefd84 | [
"Apache-2.0"
] | null | null | null | import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output, State
popover = html.Div(
[
dbc.Button(
"Click to toggle popover", id="popover-target", color="danger"
),
dbc.Popover(
[
dbc.Popov... | 23.9375 | 74 | 0.567885 | import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output, State
popover = html.Div(
[
dbc.Button(
"Click to toggle popover", id="popover-target", color="danger"
),
dbc.Popover(
[
dbc.Popov... | true | true |
f708206218289bf8000412c8894fb2157df7e624 | 1,891 | py | Python | count.py | romain-fontugne/roa-counter | 35413f036a0a75088ae318dfa3df58b3cbce6095 | [
"Apache-2.0"
] | 1 | 2022-01-24T03:09:00.000Z | 2022-01-24T03:09:00.000Z | count.py | romain-fontugne/roa-counter | 35413f036a0a75088ae318dfa3df58b3cbce6095 | [
"Apache-2.0"
] | null | null | null | count.py | romain-fontugne/roa-counter | 35413f036a0a75088ae318dfa3df58b3cbce6095 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from matplotlib import pylab as plt
from requests_cache import CachedSession
CACHE_EXPIRATION_SECS = 3600*24*356
YEAR_RANGE = range(2018, 2022)
MARKERS = ["o", "s", "d", "+", "*"]
RIRS = {
'AFRINIC': {
'url': 'https://ftp.ripe.net/ripe/rpki/afrinic.tal/',
... | 28.223881 | 76 | 0.523533 | from datetime import datetime
from matplotlib import pylab as plt
from requests_cache import CachedSession
CACHE_EXPIRATION_SECS = 3600*24*356
YEAR_RANGE = range(2018, 2022)
MARKERS = ["o", "s", "d", "+", "*"]
RIRS = {
'AFRINIC': {
'url': 'https://ftp.ripe.net/ripe/rpki/afrinic.tal/',
... | true | true |
f7082128eda5b64f709d36b4c5d806504c82228c | 11,398 | py | Python | python_poc/adapters/modbus_generic_adapter.py | pervcomp/Procem | 6cefbf6c81b51af948feb9510d39820f8e6f113e | [
"MIT"
] | 1 | 2019-01-09T14:38:44.000Z | 2019-01-09T14:38:44.000Z | python_poc/adapters/modbus_generic_adapter.py | pervcomp/Procem | 6cefbf6c81b51af948feb9510d39820f8e6f113e | [
"MIT"
] | 4 | 2021-03-09T00:03:21.000Z | 2022-02-12T05:33:21.000Z | python_poc/adapters/modbus_generic_adapter.py | pervcomp/Procem | 6cefbf6c81b51af948feb9510d39820f8e6f113e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""This module contains an adapter for reading Modbus data and sending it to Procem RTL worker."""
# Copyright (c) TUT Tampere University of Technology 2015-2018.
# This software has been developed in Procem-project funded by Business Finland.
# This code is licensed under the MIT license.
# Se... | 43.503817 | 113 | 0.650465 |
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
import datetime
import queue
import socket
import threading
import time
import sys
try:
import adapters.common_utils as common_utils
import adapters.modbus_generic_model as modbus_generic_model
import adapters.modbus_utils as modbus_utils
e... | true | true |
f70821c9013bef20bbd4b8e6e4c8fe921bf44021 | 1,306 | py | Python | ooobuild/lo/embed/hatch_window_factory.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/embed/hatch_window_factory.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/embed/hatch_window_factory.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 30.372093 | 138 | 0.742726 | from .x_hatch_window_factory import XHatchWindowFactory as XHatchWindowFactory_167d0e95
class HatchWindowFactory(XHatchWindowFactory_167d0e95):
__ooo_ns__: str = 'com.sun.star.embed'
__ooo_full_ns__: str = 'com.sun.star.embed.HatchWindowFactory'
__ooo_type_name__: str = 'service'
__all__ = ['HatchWindow... | true | true |
f7082209033fa16bf0b05b5db5d4f2960b3c91f8 | 4,412 | py | Python | hotsos/core/host_helpers/config.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 6 | 2021-10-01T19:46:14.000Z | 2022-03-31T17:05:08.000Z | hotsos/core/host_helpers/config.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 111 | 2021-10-01T18:18:17.000Z | 2022-03-29T12:23:20.000Z | hotsos/core/host_helpers/config.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 10 | 2021-09-29T14:47:54.000Z | 2022-03-18T14:52:16.000Z | import os
import re
class ConfigBase(object):
def __init__(self, path):
self.path = path
@classmethod
def squash_int_range(cls, ilist):
"""Takes a list of integers and squashes consecutive values into a
string range. Returned list contains mix of strings and ints.
"""
... | 28.836601 | 78 | 0.487307 | import os
import re
class ConfigBase(object):
def __init__(self, path):
self.path = path
@classmethod
def squash_int_range(cls, ilist):
irange = []
rstart = None
rprev = None
sorted(ilist)
for i, value in enumerate(ilist):
if rstart is None:
... | true | true |
f708227bdf1894da2e5054f9584b6866a12bb72f | 37,497 | py | Python | google/cloud/monitoring_v3/services/alert_policy_service/client.py | nicain/python-monitoring | bda4852bbe6eb28b1c93b4a785eac167b57cb7d8 | [
"Apache-2.0"
] | null | null | null | google/cloud/monitoring_v3/services/alert_policy_service/client.py | nicain/python-monitoring | bda4852bbe6eb28b1c93b4a785eac167b57cb7d8 | [
"Apache-2.0"
] | null | null | null | google/cloud/monitoring_v3/services/alert_policy_service/client.py | nicain/python-monitoring | bda4852bbe6eb28b1c93b4a785eac167b57cb7d8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 43.85614 | 109 | 0.628317 | from collections import OrderedDict
from distutils import util
import os
import re
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_... | true | true |
f708235276521e1055a17f1e583e94359571464b | 407 | py | Python | malib/algorithm/ddpg/__init__.py | zbzhu99/malib | 5be07ac00761a34fb095adb2b3018a798ceea256 | [
"MIT"
] | null | null | null | malib/algorithm/ddpg/__init__.py | zbzhu99/malib | 5be07ac00761a34fb095adb2b3018a798ceea256 | [
"MIT"
] | null | null | null | malib/algorithm/ddpg/__init__.py | zbzhu99/malib | 5be07ac00761a34fb095adb2b3018a798ceea256 | [
"MIT"
] | null | null | null | from .policy import DDPG
from .trainer import DDPGTrainer
from .loss import DDPGLoss
NAME = "DDPG"
LOSS = DDPGLoss
TRAINER = DDPGTrainer
POLICY = DDPG
CONFIG = {
"training": {
"update_interval": 1,
"batch_size": 1024,
"tau": 0.01,
"optimizer": "Adam",
"actor_lr": 1e-2,
... | 16.958333 | 34 | 0.565111 | from .policy import DDPG
from .trainer import DDPGTrainer
from .loss import DDPGLoss
NAME = "DDPG"
LOSS = DDPGLoss
TRAINER = DDPGTrainer
POLICY = DDPG
CONFIG = {
"training": {
"update_interval": 1,
"batch_size": 1024,
"tau": 0.01,
"optimizer": "Adam",
"actor_lr": 1e-2,
... | true | true |
f708236a902da8255569087afbd1a500653aa211 | 7,208 | py | Python | modules/android.py | inzanez/pdfium-lib | f4e6fbb3b29c100ff3f291944944fd7e38fafbcd | [
"MIT"
] | 69 | 2021-01-27T18:53:22.000Z | 2022-02-25T00:41:41.000Z | modules/android.py | inzanez/pdfium-lib | f4e6fbb3b29c100ff3f291944944fd7e38fafbcd | [
"MIT"
] | 31 | 2021-01-23T17:14:46.000Z | 2022-03-04T18:06:23.000Z | modules/android.py | inzanez/pdfium-lib | f4e6fbb3b29c100ff3f291944944fd7e38fafbcd | [
"MIT"
] | 19 | 2021-01-27T18:57:07.000Z | 2022-01-04T02:56:03.000Z | import glob
import os
import tarfile
from subprocess import check_call
import modules.config as c
import modules.functions as f
def run_task_build_pdfium():
f.debug("Building PDFium...")
target = "android"
build_dir = os.path.join("build", target)
f.create_dir(build_dir)
target_dir = os.path.jo... | 29.182186 | 88 | 0.517064 | import glob
import os
import tarfile
from subprocess import check_call
import modules.config as c
import modules.functions as f
def run_task_build_pdfium():
f.debug("Building PDFium...")
target = "android"
build_dir = os.path.join("build", target)
f.create_dir(build_dir)
target_dir = os.path.jo... | true | true |
f708236d0f78899c556252304ef35f5ad77e4c31 | 16,269 | py | Python | rlkit/torch/networks.py | NagisaZj/ProMP | 539739ae2b7d5fdcad00855da695f643b23df4b3 | [
"MIT"
] | null | null | null | rlkit/torch/networks.py | NagisaZj/ProMP | 539739ae2b7d5fdcad00855da695f643b23df4b3 | [
"MIT"
] | null | null | null | rlkit/torch/networks.py | NagisaZj/ProMP | 539739ae2b7d5fdcad00855da695f643b23df4b3 | [
"MIT"
] | null | null | null | """
General networks for pytorch.
Algorithm-specific networks should go else-where.
"""
import torch
from torch import nn as nn
from torch.nn import functional as F
from rlkit.policies.base import Policy
from rlkit.torch import pytorch_util as ptu
from rlkit.torch.core import PyTorchModule
from rlkit.torch.data_manag... | 32.933198 | 101 | 0.605262 | import torch
from torch import nn as nn
from torch.nn import functional as F
from rlkit.policies.base import Policy
from rlkit.torch import pytorch_util as ptu
from rlkit.torch.core import PyTorchModule
from rlkit.torch.data_management.normalizer import TorchFixedNormalizer
from rlkit.torch.modules import LayerNorm
im... | true | true |
f70824aa75c16cfcf7a1046989c882d7009972df | 1,551 | py | Python | src/gists-gihub/9ba0c82b846dba2566fbf72d06be0b65/test01.py | MrPivato/arquivos-de-procedencia-duvidosa | 62ee2cdef0d1b3a25566671411575db1916706f9 | [
"MIT"
] | null | null | null | src/gists-gihub/9ba0c82b846dba2566fbf72d06be0b65/test01.py | MrPivato/arquivos-de-procedencia-duvidosa | 62ee2cdef0d1b3a25566671411575db1916706f9 | [
"MIT"
] | null | null | null | src/gists-gihub/9ba0c82b846dba2566fbf72d06be0b65/test01.py | MrPivato/arquivos-de-procedencia-duvidosa | 62ee2cdef0d1b3a25566671411575db1916706f9 | [
"MIT"
] | null | null | null | '''
multilinha
comentario
aqui
'''
a = 10
b = 2
val1 = 123456
val2 = "sopa de ....."
val3 = 123.123
print("\n")
# operadores logicos
print(a == b) # vc ja sabe oq eh
print(a != b) # vc ja sabe oq eh
print(a < b) # vc ja sabe oq eh
print(a >= b) # vc ja sabe oq eh
print(a <= b) # vc ja sabe oq eh
print("\n")
# m... | 24.619048 | 68 | 0.643456 | a = 10
b = 2
val1 = 123456
val2 = "sopa de ....."
val3 = 123.123
print("\n")
print(a == b) print(a != b) print(a < b) print(a >= b) print(a <= b)
print("\n")
print(a**b) print(a**(a + b)) print(a**(a + b) % 7)
print("\n")
print(type(val1)) print(type(val2)) print(type(val3)) print(type(a)) prin... | true | true |
f70824ffe664a17d8bdf048e954d141fb89d84df | 832 | py | Python | setup.py | gruentee/fever-api | 58811ef7527482b77b28d291993afa2c63aa60c0 | [
"Apache-2.0"
] | null | null | null | setup.py | gruentee/fever-api | 58811ef7527482b77b28d291993afa2c63aa60c0 | [
"Apache-2.0"
] | null | null | null | setup.py | gruentee/fever-api | 58811ef7527482b77b28d291993afa2c63aa60c0 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
import sys
with open('requirements.txt') as f:
reqs = f.read()
reqs = reqs.strip().split('\n')
install = [req for req in reqs if not req.startswith("git+git://")]
depends = [req.replace("git+git://", "git+http://") for req in reqs if req.startswith("git+git://")]
setu... | 26.83871 | 100 | 0.620192 | from setuptools import setup, find_packages
import sys
with open('requirements.txt') as f:
reqs = f.read()
reqs = reqs.strip().split('\n')
install = [req for req in reqs if not req.startswith("git+git://")]
depends = [req.replace("git+git://", "git+http://") for req in reqs if req.startswith("git+git://")]
setu... | true | true |
f708250955cabd36d394352f565efdbc6e091c63 | 2,213 | py | Python | tests/text/test_sentsplit.py | evendrow/ifcc | ae6ea6f19028ba5d367c086fe94cfe4237829059 | [
"Apache-2.0"
] | 43 | 2020-10-21T03:25:21.000Z | 2022-03-26T08:13:06.000Z | tests/text/test_sentsplit.py | evendrow/ifcc | ae6ea6f19028ba5d367c086fe94cfe4237829059 | [
"Apache-2.0"
] | 8 | 2020-12-04T15:06:45.000Z | 2022-03-28T12:18:14.000Z | tests/text/test_sentsplit.py | evendrow/ifcc | ae6ea6f19028ba5d367c086fe94cfe4237829059 | [
"Apache-2.0"
] | 10 | 2020-11-13T03:46:09.000Z | 2022-02-05T21:39:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from clinicgen.text.sentsplit import LineBreakSplitter, NLTKSentenceSplitter, SpaCySentenceSplitter, StanzaSentenceSplitter
class TestLineBreakSplitter(unittest.TestCase):
def test_split(self):
splitter = LineBreakSplitter()
text = 'He... | 43.392157 | 123 | 0.694984 |
import unittest
from clinicgen.text.sentsplit import LineBreakSplitter, NLTKSentenceSplitter, SpaCySentenceSplitter, StanzaSentenceSplitter
class TestLineBreakSplitter(unittest.TestCase):
def test_split(self):
splitter = LineBreakSplitter()
text = 'Hello NLP! Running a test\nof sentence splitting... | true | true |
f70825c17a7334392f3af2030a67a375fb7d0b26 | 5,698 | py | Python | cruft/_commands/utils/generate.py | lkubb/cruft | 0c6de85d974197969c0e65913857eaa36b788e5e | [
"MIT"
] | 293 | 2020-08-18T05:52:45.000Z | 2022-03-31T20:39:43.000Z | cruft/_commands/utils/generate.py | lkubb/cruft | 0c6de85d974197969c0e65913857eaa36b788e5e | [
"MIT"
] | 102 | 2020-08-28T16:38:34.000Z | 2022-03-31T11:01:41.000Z | cruft/_commands/utils/generate.py | lkubb/cruft | 0c6de85d974197969c0e65913857eaa36b788e5e | [
"MIT"
] | 36 | 2020-08-28T16:34:10.000Z | 2022-03-31T21:55:53.000Z | import os
import stat
from pathlib import Path
from shutil import move, rmtree
from typing import Optional, Set, Union
from warnings import warn
from cookiecutter.generate import generate_files
from git import Repo
from .cookiecutter import CookiecutterContext, generate_cookiecutter_context
from .cruft import CruftSt... | 35.836478 | 99 | 0.68252 | import os
import stat
from pathlib import Path
from shutil import move, rmtree
from typing import Optional, Set, Union
from warnings import warn
from cookiecutter.generate import generate_files
from git import Repo
from .cookiecutter import CookiecutterContext, generate_cookiecutter_context
from .cruft import CruftSt... | true | true |
f70827e38991a94ce5912d7f8da1ac9aef505f01 | 316 | py | Python | ML_CW1/assgn_1_part_1/2_multiple_variables/plot_cost.py | ShellySrivastava/Machine-Learning | bfdea30c06abe4228c103ae525adcf990015983f | [
"MIT"
] | null | null | null | ML_CW1/assgn_1_part_1/2_multiple_variables/plot_cost.py | ShellySrivastava/Machine-Learning | bfdea30c06abe4228c103ae525adcf990015983f | [
"MIT"
] | null | null | null | ML_CW1/assgn_1_part_1/2_multiple_variables/plot_cost.py | ShellySrivastava/Machine-Learning | bfdea30c06abe4228c103ae525adcf990015983f | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import os
def plot_cost(cost):
fig, ax1 = plt.subplots()
ax1.set_xlabel('Iterations')
ax1.set_ylabel('Cost')
plt.plot(cost)
fig.tight_layout()
plot_filename = os.path.join(os.getcwd(), 'figures', 'cost.png')
plt.savefig(plot_filename)
plt.show()
| 22.571429 | 68 | 0.661392 | import matplotlib.pyplot as plt
import os
def plot_cost(cost):
fig, ax1 = plt.subplots()
ax1.set_xlabel('Iterations')
ax1.set_ylabel('Cost')
plt.plot(cost)
fig.tight_layout()
plot_filename = os.path.join(os.getcwd(), 'figures', 'cost.png')
plt.savefig(plot_filename)
plt.show()
| true | true |
f7082804270c08c354dbffdcaf9e8d5dc7390978 | 34 | py | Python | settable_generator/__init__.py | markusschmaus/map_structure | f1417230cff2657b28dcb44f70ef38ed02d7ba7d | [
"MIT"
] | null | null | null | settable_generator/__init__.py | markusschmaus/map_structure | f1417230cff2657b28dcb44f70ef38ed02d7ba7d | [
"MIT"
] | null | null | null | settable_generator/__init__.py | markusschmaus/map_structure | f1417230cff2657b28dcb44f70ef38ed02d7ba7d | [
"MIT"
] | null | null | null | from .settable_generator import *
| 17 | 33 | 0.823529 | from .settable_generator import *
| true | true |
f70828b88a42c74567ef99b3f01c0cad6c366906 | 2,053 | py | Python | tensorflow_datasets/image/__init__.py | ubershmekel/datasets | 555220a3bf048a1bed6aed5db97696fb83088b83 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image/__init__.py | ubershmekel/datasets | 555220a3bf048a1bed6aed5db97696fb83088b83 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image/__init__.py | ubershmekel/datasets | 555220a3bf048a1bed6aed5db97696fb83088b83 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... | 50.073171 | 97 | 0.857282 |
from tensorflow_datasets.image.cats_vs_dogs import CatsVsDogs
from tensorflow_datasets.image.celeba import CelebA
from tensorflow_datasets.image.celebahq import CelebAHq
from tensorflow_datasets.image.chexpert import Chexpert
from tensorflow_datasets.image.cifar import Cifar10
from tensorflow_datasets.image.cifar imp... | true | true |
f708296b42266a152e2db50c2035ba466629cfe8 | 4,729 | py | Python | src/TOU.py | e2thenegpii/EnergyCalc | 6036b08d01eafae33e80e8754c0e0215c78db6fe | [
"MIT"
] | null | null | null | src/TOU.py | e2thenegpii/EnergyCalc | 6036b08d01eafae33e80e8754c0e0215c78db6fe | [
"MIT"
] | null | null | null | src/TOU.py | e2thenegpii/EnergyCalc | 6036b08d01eafae33e80e8754c0e0215c78db6fe | [
"MIT"
] | null | null | null | from enum import Enum
from datetime import datetime, date
from dateutil.relativedelta import relativedelta, MO
import argparse
import holidays
import pandas as pd
class BGEHolidays(holidays.HolidayBase):
def _populate(self, year):
holidays.UnitedStates._populate(self, year)
# Remove Martin Luther... | 34.021583 | 137 | 0.554663 | from enum import Enum
from datetime import datetime, date
from dateutil.relativedelta import relativedelta, MO
import argparse
import holidays
import pandas as pd
class BGEHolidays(holidays.HolidayBase):
def _populate(self, year):
holidays.UnitedStates._populate(self, year)
self.pop(date(... | true | true |
f7082a6f9e21d7c86d50e21ff2f273fcab648c48 | 110 | py | Python | oppurtunity/admin.py | ParasBotadra/djangocrm | aeb5f6af35e74c4509ef5731549ce4ed445263d7 | [
"MIT"
] | 2 | 2018-02-15T15:33:00.000Z | 2018-02-15T16:29:12.000Z | oppurtunity/admin.py | ParasBotadra/djangocrm | aeb5f6af35e74c4509ef5731549ce4ed445263d7 | [
"MIT"
] | 1 | 2018-08-31T08:54:22.000Z | 2018-08-31T08:54:22.000Z | oppurtunity/admin.py | ParasBotadra/djangocrm | aeb5f6af35e74c4509ef5731549ce4ed445263d7 | [
"MIT"
] | 12 | 2017-11-02T22:32:32.000Z | 2018-04-12T05:13:25.000Z | from django.contrib import admin
from oppurtunity.models import Opportunity
admin.site.register(Opportunity)
| 22 | 42 | 0.854545 | from django.contrib import admin
from oppurtunity.models import Opportunity
admin.site.register(Opportunity)
| true | true |
f7082ad992bcca14397fb0a69109b4b7dd0df0b1 | 6,541 | py | Python | FRAMS_STUDENT.py | AshwinRameshP/AttendanceSystem_FaceRecognition | 23c590c10ac296816d7cff23445d28c3863d0138 | [
"MIT"
] | 1 | 2021-02-17T19:36:20.000Z | 2021-02-17T19:36:20.000Z | FRAMS_STUDENT.py | AshwinRameshP/AttendanceSystem_FaceRecognition | 23c590c10ac296816d7cff23445d28c3863d0138 | [
"MIT"
] | null | null | null | FRAMS_STUDENT.py | AshwinRameshP/AttendanceSystem_FaceRecognition | 23c590c10ac296816d7cff23445d28c3863d0138 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import *
import cv2
import csv
import os
import numpy as np
from PIL import Image,ImageTk
import pandas as pd
import datetime
import time
##Error screen2
def del_sc2():
sc2.destroy()
def err_screen1():
global sc2
sc2 = tk.Tk()
sc2.geometry('300x100')
sc2.iconbitma... | 41.138365 | 165 | 0.504663 | import tkinter as tk
from tkinter import *
import cv2
import csv
import os
import numpy as np
from PIL import Image,ImageTk
import pandas as pd
import datetime
import time
def del_sc2():
sc2.destroy()
def err_screen1():
global sc2
sc2 = tk.Tk()
sc2.geometry('300x100')
sc2.iconbitmap('FRAMS.ico')
... | true | true |
f7082d5845fd1efee69baec36ac43ffaecac25f9 | 9,352 | py | Python | tensorflow_text/python/ops/bert_tokenizer.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | tensorflow_text/python/ops/bert_tokenizer.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | tensorflow_text/python/ops/bert_tokenizer.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 TF.Text 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 ag... | 41.017544 | 80 | 0.70648 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import lookup_ops
from tensorflow.... | true | true |
f7082efb53a2eda2c514e37d2265b58567d794a1 | 29,415 | py | Python | python/ccxt/bithumb.py | DanPmkr/ccxt | 0a6cc2b805323b5ec226feff2347f07194104364 | [
"MIT"
] | null | null | null | python/ccxt/bithumb.py | DanPmkr/ccxt | 0a6cc2b805323b5ec226feff2347f07194104364 | [
"MIT"
] | null | null | null | python/ccxt/bithumb.py | DanPmkr/ccxt | 0a6cc2b805323b5ec226feff2347f07194104364 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import base64
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | 39.115691 | 292 | 0.478599 |
from ccxt.base.exchange import Exchange
import base64
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors im... | true | true |
f7082effdfcc3ae6724076920b4094deda3a13b3 | 5,123 | py | Python | btc/ecpoint.py | DagonR/simplebtclib | 63ad331902433cc8c357463eea2fe73bb8831c73 | [
"MIT"
] | null | null | null | btc/ecpoint.py | DagonR/simplebtclib | 63ad331902433cc8c357463eea2fe73bb8831c73 | [
"MIT"
] | null | null | null | btc/ecpoint.py | DagonR/simplebtclib | 63ad331902433cc8c357463eea2fe73bb8831c73 | [
"MIT"
] | null | null | null | from btc.utils import mod_inverse, int2hex
# Parameters for SECP256k1 elliptic curve (used by Bitcoin)
SECP256K1_A = 0
SECP256K1_B = 7
SECP256K1_GX = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
SECP256K1_GY = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
SECP256K1_P = 2**25... | 27.543011 | 84 | 0.519813 | from btc.utils import mod_inverse, int2hex
SECP256K1_A = 0
SECP256K1_B = 7
SECP256K1_GX = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
SECP256K1_GY = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
SECP256K1_P = 2**256 - 2**32 - 2**9 - 2**8 - 2**7 - 2**6 - 2**4 - 1
SECP256K1_O... | true | true |
f708301dab84462cdc546c456f38ab6d6b2e0329 | 10,506 | py | Python | addons/mixer/blender_data/struct_proxy.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | null | null | null | addons/mixer/blender_data/struct_proxy.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | null | null | null | addons/mixer/blender_data/struct_proxy.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | null | null | null | # GPLv3 License
#
# Copyright (C) 2020 Ubisoft
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is dis... | 38.625 | 119 | 0.642395 |
from __future__ import annotations
from functools import lru_cache
import logging
from typing import Optional, Tuple, TYPE_CHECKING, Union
import bpy.types as T
from mixer.blender_data import specifics
from mixer.blender_data.attributes import apply_attribute, diff_attribute, read_attribute, write_attribute
from m... | true | true |
f70830a1dfe16d9acb4b0fb3104b724a08d7490c | 2,893 | py | Python | inference.py | riotu-lab/tf2trt_with_onnx | f9828ed99af5530836bf6ee608e631502dfb0f02 | [
"MIT"
] | 12 | 2020-10-08T21:59:28.000Z | 2022-02-05T00:13:41.000Z | inference.py | riotu-lab/tf2trt_with_onnx | f9828ed99af5530836bf6ee608e631502dfb0f02 | [
"MIT"
] | 3 | 2020-11-19T15:13:17.000Z | 2022-03-07T06:54:45.000Z | inference.py | riotu-lab/tf2trt_with_onnx | f9828ed99af5530836bf6ee608e631502dfb0f02 | [
"MIT"
] | 7 | 2020-10-08T21:59:13.000Z | 2022-01-20T06:37:15.000Z | import tensorrt as trt
import pycuda.driver as cuda
import numpy as np
import pycuda.autoinit
def allocate_buffers(engine, batch_size, data_type):
"""
This is the function to allocate buffers for input and output in the device
Args:
engine : The path to the TensorRT engine.
batch_size : The bat... | 36.1625 | 125 | 0.696854 | import tensorrt as trt
import pycuda.driver as cuda
import numpy as np
import pycuda.autoinit
def allocate_buffers(engine, batch_size, data_type):
h_input_1 = cuda.pagelocked_empty(batch_size * trt.volume(engine.get_binding_shape(0)), dtype=trt.nptype(data_type))
h_output = cuda.pagelocked_empty(batch_size... | true | true |
f70831b92f771b21149a5234b61179e970fa0c1c | 2,406 | py | Python | parquet/__main__.py | snowch/parquet-python | e2caab7aceca91a3075998d0113e186f8ba2ca37 | [
"Apache-2.0"
] | 1 | 2019-03-23T15:15:49.000Z | 2019-03-23T15:15:49.000Z | parquet/__main__.py | snowch/parquet-python | e2caab7aceca91a3075998d0113e186f8ba2ca37 | [
"Apache-2.0"
] | null | null | null | parquet/__main__.py | snowch/parquet-python | e2caab7aceca91a3075998d0113e186f8ba2ca37 | [
"Apache-2.0"
] | null | null | null | """parquet - tool for inspecting parquet files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import sys
def setup_logging(options=None):
"""Configure logging based on options... | 36.454545 | 79 | 0.621363 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import sys
def setup_logging(options=None):
level = logging.DEBUG if options is not None and options.debug \
else logging.WA... | true | true |
f70831d31c18c271d339fcd121ce8405c9acc39f | 1,722 | py | Python | tests/test_assembler.py | proksee-project/proksee-cmd | c8a3eaaf1b0f46a0842972f54f805bbf6a2936ab | [
"Apache-2.0"
] | null | null | null | tests/test_assembler.py | proksee-project/proksee-cmd | c8a3eaaf1b0f46a0842972f54f805bbf6a2936ab | [
"Apache-2.0"
] | 2 | 2021-10-21T16:55:04.000Z | 2021-12-10T17:25:38.000Z | tests/test_assembler.py | proksee-project/proksee-cmd | c8a3eaaf1b0f46a0842972f54f805bbf6a2936ab | [
"Apache-2.0"
] | null | null | null | """
Copyright Government of Canada 2021
Written by: Eric Marinier, National Microbiology Laboratory,
Public Health Agency of Canada
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this work except in compliance with the License. You may obtain a copy of the
License at:
htt... | 35.142857 | 79 | 0.75784 |
import os
from pathlib import Path
from proksee.assembler import Assembler
from proksee.reads import Reads
from proksee.skesa_assembler import SkesaAssembler
from proksee.resource_specification import ResourceSpecification
INPUT_DIR = os.path.join(Path(__file__).parent.absolute(), "data")
OUTPUT_DIR = os.path.join(P... | true | true |
f70832591120e472b3249e3d56d542f352f77c6e | 2,011 | py | Python | 2021/day15.py | tcbegley/advent-of-code | e293d06e9cd994b26c0d10619672a6d8d2d65377 | [
"MIT"
] | 6 | 2021-12-05T11:21:17.000Z | 2021-12-07T03:04:24.000Z | 2021/day15.py | tcbegley/advent-of-code | e293d06e9cd994b26c0d10619672a6d8d2d65377 | [
"MIT"
] | null | null | null | 2021/day15.py | tcbegley/advent-of-code | e293d06e9cd994b26c0d10619672a6d8d2d65377 | [
"MIT"
] | null | null | null | import heapq
import sys
from itertools import product
def load_data(path):
with open(path) as f:
return {
(i, j): int(value)
for i, line in enumerate(f.readlines())
for j, value in enumerate(line.strip())
}
def get_neighbours(loc, n_rows, n_cols):
neighbou... | 24.52439 | 79 | 0.526604 | import heapq
import sys
from itertools import product
def load_data(path):
with open(path) as f:
return {
(i, j): int(value)
for i, line in enumerate(f.readlines())
for j, value in enumerate(line.strip())
}
def get_neighbours(loc, n_rows, n_cols):
neighbou... | true | true |
f708346fbf06081c549ed239fbba07d0ba8a6bb1 | 2,176 | py | Python | mediathekDownloader/vsMetaInfoGenerator.py | TomMeHo/mediathekDownloader | 645f76b5df6710ee7cd8c761c44e6e61c026d849 | [
"MIT"
] | 1 | 2022-01-26T19:09:56.000Z | 2022-01-26T19:09:56.000Z | mediathekDownloader/vsMetaInfoGenerator.py | TomMeHo/mediathekDownloader | 645f76b5df6710ee7cd8c761c44e6e61c026d849 | [
"MIT"
] | null | null | null | mediathekDownloader/vsMetaInfoGenerator.py | TomMeHo/mediathekDownloader | 645f76b5df6710ee7cd8c761c44e6e61c026d849 | [
"MIT"
] | null | null | null | import re
from vsmetaEncoder import vsmetaInfo
from datetime import datetime, date
class VsMetaInfoGenerator(vsmetaInfo.VsMetaInfo):
def __init__(self, feedItem):
super(VsMetaInfoGenerator, self).__init__()
self.feedItem = feedItem
self.download_url = ''
# parse feedItem
... | 43.52 | 146 | 0.613511 | import re
from vsmetaEncoder import vsmetaInfo
from datetime import datetime, date
class VsMetaInfoGenerator(vsmetaInfo.VsMetaInfo):
def __init__(self, feedItem):
super(VsMetaInfoGenerator, self).__init__()
self.feedItem = feedItem
self.download_url = ''
if hasattr(feed... | true | true |
f7083472e4dfe4d2a370ff6e2b3b22f4880c3fc2 | 3,213 | py | Python | lingvo/tasks/car/pointnet_test.py | argideritzalpea/lingvo | 0b13f9b02f8cf2167a1b80a43222257f2140e1e8 | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/car/pointnet_test.py | argideritzalpea/lingvo | 0b13f9b02f8cf2167a1b80a43222257f2140e1e8 | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/car/pointnet_test.py | argideritzalpea/lingvo | 0b13f9b02f8cf2167a1b80a43222257f2140e1e8 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 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
#
... | 40.1625 | 80 | 0.691566 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from lingvo import compat as tf
from lingvo.core import py_utils
from lingvo.core import test_utils
from lingvo.tasks.car import pointnet
class PointNetTest(test_utils.... | true | true |
f70834ecb56114e1accacc671d423b1fb09b1f29 | 894 | py | Python | migrations/versions/f025f89b250b_.py | Misschl/flask-fresh | df17fd377b9e27aaad9fe0c5582c56098d09068c | [
"Apache-2.0"
] | null | null | null | migrations/versions/f025f89b250b_.py | Misschl/flask-fresh | df17fd377b9e27aaad9fe0c5582c56098d09068c | [
"Apache-2.0"
] | null | null | null | migrations/versions/f025f89b250b_.py | Misschl/flask-fresh | df17fd377b9e27aaad9fe0c5582c56098d09068c | [
"Apache-2.0"
] | 1 | 2020-12-21T14:01:53.000Z | 2020-12-21T14:01:53.000Z | """empty message
Revision ID: f025f89b250b
Revises: 37eabcbbb8fb
Create Date: 2019-10-19 18:12:48.976655
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f025f89b250b'
down_revision = '37eabcbbb8fb'
branch_labels = None
depends_on = None
def upgrade():
# ... | 25.542857 | 70 | 0.684564 | from alembic import op
import sqlalchemy as sa
revision = 'f025f89b250b'
down_revision = '37eabcbbb8fb'
branch_labels = None
depends_on = None
def upgrade():
op.create_table('df_goods_image',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('sku', sa.Integer(), nullable=T... | true | true |
f708357a9d0245994baa7acb8be387d0dcb38cf4 | 2,347 | py | Python | databuilder/extractor/dashboard/mode_analytics/mode_dashboard_usage_extractor.py | lynrayjumo/amundsendatabuilder | f1e7e246f8f4f72ad0ef5df3ef52e0e379e078f8 | [
"Apache-2.0"
] | null | null | null | databuilder/extractor/dashboard/mode_analytics/mode_dashboard_usage_extractor.py | lynrayjumo/amundsendatabuilder | f1e7e246f8f4f72ad0ef5df3ef52e0e379e078f8 | [
"Apache-2.0"
] | 1 | 2020-07-07T08:44:33.000Z | 2020-07-07T08:44:33.000Z | databuilder/extractor/dashboard/mode_analytics/mode_dashboard_usage_extractor.py | lynrayjumo/amundsendatabuilder | f1e7e246f8f4f72ad0ef5df3ef52e0e379e078f8 | [
"Apache-2.0"
] | 1 | 2020-08-12T09:51:58.000Z | 2020-08-12T09:51:58.000Z | import logging
from pyhocon import ConfigTree # noqa: F401
from typing import Any # noqa: F401
from databuilder.extractor.base_extractor import Extractor
from databuilder.extractor.dashboard.mode_analytics.mode_dashboard_utils import ModeDashboardUtils
from databuilder.rest_api.mode_analytics.mode_paginated_rest_ap... | 39.116667 | 118 | 0.688539 | import logging
from pyhocon import ConfigTree from typing import Any
from databuilder.extractor.base_extractor import Extractor
from databuilder.extractor.dashboard.mode_analytics.mode_dashboard_utils import ModeDashboardUtils
from databuilder.rest_api.mode_analytics.mode_paginated_rest_api_query import ModePaginat... | true | true |
f70835b4ce9ae1fc5c692777609f137cc7b8f0ac | 536 | py | Python | vehicle/signals.py | COS301-SE-2020/ctrlintelligencecapstone | ddfc92408ed296c6bf64b2dd071b948a1446ede8 | [
"MIT"
] | null | null | null | vehicle/signals.py | COS301-SE-2020/ctrlintelligencecapstone | ddfc92408ed296c6bf64b2dd071b948a1446ede8 | [
"MIT"
] | null | null | null | vehicle/signals.py | COS301-SE-2020/ctrlintelligencecapstone | ddfc92408ed296c6bf64b2dd071b948a1446ede8 | [
"MIT"
] | 1 | 2021-05-18T02:53:10.000Z | 2021-05-18T02:53:10.000Z | from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Vehicle, ImageSpacec
from darknet_dmg import detect
@receiver(post_save, sender=Vehicle)
def damage_detection(sender, instance, **kwargs):
image = ImageSpace.objects.filter(vehicle=instance.id).last()
path =... | 38.285714 | 145 | 0.774254 | from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Vehicle, ImageSpacec
from darknet_dmg import detect
@receiver(post_save, sender=Vehicle)
def damage_detection(sender, instance, **kwargs):
image = ImageSpace.objects.filter(vehicle=instance.id).last()
path =... | true | true |
f708362f3738f4d4e8d3a496b9a1cf7f11134174 | 1,981 | py | Python | src/webapp/pages/about.py | christianbernasconi96/ProductNetworkAnalysis | 4d7a003cc81471f43a918a761c941e2effb7d2a3 | [
"MIT"
] | null | null | null | src/webapp/pages/about.py | christianbernasconi96/ProductNetworkAnalysis | 4d7a003cc81471f43a918a761c941e2effb7d2a3 | [
"MIT"
] | null | null | null | src/webapp/pages/about.py | christianbernasconi96/ProductNetworkAnalysis | 4d7a003cc81471f43a918a761c941e2effb7d2a3 | [
"MIT"
] | null | null | null | import dash
import dash_core_components as dcc
import dash_html_components as html
about_layout = [html.Div(children=[
html.Img(src='/assets/logo.png', className='logo-big', style={'marginTop': 'auto', 'marginBottom': 'auto'}),
html.Div(children='Network and Sentiment Anlysis on Amazon Dataset', className="tex... | 60.030303 | 196 | 0.597173 | import dash
import dash_core_components as dcc
import dash_html_components as html
about_layout = [html.Div(children=[
html.Img(src='/assets/logo.png', className='logo-big', style={'marginTop': 'auto', 'marginBottom': 'auto'}),
html.Div(children='Network and Sentiment Anlysis on Amazon Dataset', className="tex... | true | true |
f708366b7c8d41d94e7efbd36318e9496e569d45 | 427 | py | Python | backend/athena_dream_stodio_33748/wsgi.py | crowdbotics-apps/athena-dream-stodio-33748 | fee18065c2a4f93c88a9c8f951966d443cd1f6a7 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/athena_dream_stodio_33748/wsgi.py | crowdbotics-apps/athena-dream-stodio-33748 | fee18065c2a4f93c88a9c8f951966d443cd1f6a7 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/athena_dream_stodio_33748/wsgi.py | crowdbotics-apps/athena-dream-stodio-33748 | fee18065c2a4f93c88a9c8f951966d443cd1f6a7 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for athena_dream_stodio_33748 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.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdef... | 25.117647 | 85 | 0.803279 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'athena_dream_stodio_33748.settings')
application = get_wsgi_application()
| true | true |
f70836887d9943e7d1cb1ae6d5c8c439f35b9265 | 31,586 | py | Python | electrum/interface.py | samedamci/LBRY-Vault | b37b37ce1bc25f8e4b753021978ab9916556137e | [
"MIT"
] | 7 | 2020-03-20T10:20:29.000Z | 2021-04-21T12:46:25.000Z | electrum/interface.py | samedamci/LBRY-Vault | b37b37ce1bc25f8e4b753021978ab9916556137e | [
"MIT"
] | 2 | 2021-08-08T03:28:58.000Z | 2021-08-23T08:42:37.000Z | electrum/interface.py | samedamci/LBRY-Vault | b37b37ce1bc25f8e4b753021978ab9916556137e | [
"MIT"
] | 3 | 2020-12-16T02:14:54.000Z | 2021-04-21T18:35:25.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 witho... | 40.914508 | 119 | 0.62151 | import os
import re
import ssl
import sys
import traceback
import asyncio
import socket
from typing import Tuple, Union, List, TYPE_CHECKING, Optional, Set
from collections import defaultdict
from ipaddress import IPv4Network, IPv6Network, ip_address, IPv6Address
import itertools
import logging
import aiorpcx
from aio... | true | true |
f70837a499b1d28edfb1813bcb87347da0b28f10 | 812 | py | Python | mmtbx/command_line/ss_idealization.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/command_line/ss_idealization.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/command_line/ss_idealization.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
# LIBTBX_SET_DISPATCHER_NAME mmtbx.ss_idealization
from mmtbx.secondary_structure import build as ssb
import mmtbx.model
import iotbx.pdb
import os, sys
def run(args):
pdb_inp = iotbx.pdb.input(source_info=None,
file_name=args[0])
model = mmtbx.model.manager(
model_inpu... | 25.375 | 73 | 0.726601 | from __future__ import division
from mmtbx.secondary_structure import build as ssb
import mmtbx.model
import iotbx.pdb
import os, sys
def run(args):
pdb_inp = iotbx.pdb.input(source_info=None,
file_name=args[0])
model = mmtbx.model.manager(
model_input=pdb_inp)
params = ssb.master_phil.extract()
p... | false | true |
f708384c5609521d4be0fae187e770797ca48abf | 7,973 | py | Python | sharpy/managers/extensions/memory_manager.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | sharpy/managers/extensions/memory_manager.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | sharpy/managers/extensions/memory_manager.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | from collections import deque
from typing import Dict, Set, Deque, List, Optional
from sc2.data import Race
from sc2.position import Point2
from sharpy.events import UnitDestroyedEvent
from sharpy.interfaces import IMemoryManager
from sharpy.managers.core import ManagerBase
from sc2.ids.unit_typeid import UnitTypeId
f... | 38.331731 | 121 | 0.660103 | from collections import deque
from typing import Dict, Set, Deque, List, Optional
from sc2.data import Race
from sc2.position import Point2
from sharpy.events import UnitDestroyedEvent
from sharpy.interfaces import IMemoryManager
from sharpy.managers.core import ManagerBase
from sc2.ids.unit_typeid import UnitTypeId
f... | true | true |
f708393c18e2c977b6debb3a1a165eba6ac0e37d | 18,133 | py | Python | tests/unit/states/test_zpool.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 19 | 2016-01-29T14:37:52.000Z | 2022-03-30T18:08:01.000Z | tests/unit/states/test_zpool.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 223 | 2016-03-02T16:39:41.000Z | 2022-03-03T12:26:35.000Z | tests/unit/states/test_zpool.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 64 | 2016-02-04T19:45:26.000Z | 2021-12-15T02:02:31.000Z | """
Tests for salt.states.zpool
:codeauthor: Jorge Schrauwen <sjorge@blackdot.be>
:maintainer: Jorge Schrauwen <sjorge@blackdot.be>
:maturity: new
:depends: salt.utils.zfs, salt.modules.zpool
:platform: illumos,freebsd,linux
"""
import salt.loader
import salt.states.zpool as zpool
import salt.ut... | 35.346979 | 105 | 0.456295 |
import salt.loader
import salt.states.zpool as zpool
import salt.utils.zfs
from salt.utils.odict import OrderedDict
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
from tests.support.zfs import ZFSMockData
class ZpoolTestC... | true | true |
f7083a24574c3c411dcabf8ccf101df2fc7fb4a6 | 826 | py | Python | adl_lrs/urls.py | Sembian/ADL_LRS | 3535dad6371af3f9f5b67f7eabfd0f4a393e0d62 | [
"Apache-2.0"
] | null | null | null | adl_lrs/urls.py | Sembian/ADL_LRS | 3535dad6371af3f9f5b67f7eabfd0f4a393e0d62 | [
"Apache-2.0"
] | null | null | null | adl_lrs/urls.py | Sembian/ADL_LRS | 3535dad6371af3f9f5b67f7eabfd0f4a393e0d62 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='/xAPI/')),
url(r'^XAPI/', include('lrs.urls')... | 34.416667 | 77 | 0.68523 | from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='/xAPI/')),
url(r'^XAPI/', include('lrs.urls')),
url(r'^xapi/', include('lrs.urls')),
url(... | true | true |
f7083ab5c7e7774c6fca62fde92fc3109732189f | 2,171 | py | Python | app/eventFrameTemplateViews/forms.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 27 | 2017-11-27T05:01:05.000Z | 2020-11-14T19:52:26.000Z | app/eventFrameTemplateViews/forms.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 259 | 2017-11-23T00:43:26.000Z | 2020-11-03T01:07:30.000Z | app/eventFrameTemplateViews/forms.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 8 | 2018-10-29T04:39:29.000Z | 2020-10-01T22:18:12.000Z | from flask_wtf import FlaskForm
from wtforms import BooleanField, HiddenField, StringField, SubmitField, ValidationError
from wtforms.validators import Length, Required
from .. models import EventFrameTemplateView
class CopyEventFrameTemplateViewForm(FlaskForm):
name = StringField("Name", validators = [Required(), Le... | 45.229167 | 147 | 0.773376 | from flask_wtf import FlaskForm
from wtforms import BooleanField, HiddenField, StringField, SubmitField, ValidationError
from wtforms.validators import Length, Required
from .. models import EventFrameTemplateView
class CopyEventFrameTemplateViewForm(FlaskForm):
name = StringField("Name", validators = [Required(), Le... | true | true |
f7083b910d5d6d417596ef3c8b9fb8bfaf516c59 | 411 | py | Python | hackerankteste.py | DMGAP/Python-Hackerrank | 891fa7365d9acf71cc5827c248f10880c0f9d1a6 | [
"MIT"
] | 2 | 2021-09-12T14:56:14.000Z | 2021-10-15T16:33:14.000Z | hackerankteste.py | DMGAP/Python-Hackerrank | 891fa7365d9acf71cc5827c248f10880c0f9d1a6 | [
"MIT"
] | null | null | null | hackerankteste.py | DMGAP/Python-Hackerrank | 891fa7365d9acf71cc5827c248f10880c0f9d1a6 | [
"MIT"
] | null | null | null | import math
import os
import random
import re
import sys
n = int(input(""))
number = int(n)
number= n%2
if n ==1:
print("Weird")
else:
if (number==0) and (n >= 2) or ((number==0) and (n <= 5)):
print("Not Weird")
elif (number ==0) and (n>=6) and ((number==0) and (n<=20)):
print ("Weird")
... | 18.681818 | 63 | 0.532847 | import math
import os
import random
import re
import sys
n = int(input(""))
number = int(n)
number= n%2
if n ==1:
print("Weird")
else:
if (number==0) and (n >= 2) or ((number==0) and (n <= 5)):
print("Not Weird")
elif (number ==0) and (n>=6) and ((number==0) and (n<=20)):
print ("Weird")
... | true | true |
f7083c004337c3ce960bf0d789441131c57bd225 | 2,082 | py | Python | src/transformers4/models/convbert/convert_convbert_original_tf1_checkpoint_to_pytorch_and_tf2.py | yangkevin2/transformers4 | 4d841db3effaa42aef9ac5babdc50f5233394358 | [
"Apache-2.0"
] | null | null | null | src/transformers4/models/convbert/convert_convbert_original_tf1_checkpoint_to_pytorch_and_tf2.py | yangkevin2/transformers4 | 4d841db3effaa42aef9ac5babdc50f5233394358 | [
"Apache-2.0"
] | null | null | null | src/transformers4/models/convbert/convert_convbert_original_tf1_checkpoint_to_pytorch_and_tf2.py | yangkevin2/transformers4 | 4d841db3effaa42aef9ac5babdc50f5233394358 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... | 37.178571 | 118 | 0.756484 |
import argparse
from transformers4 import ConvBertConfig, ConvBertModel, TFConvBertModel, load_tf_weights_in_convbert
from transformers4.utils import logging
logging.set_verbosity_info()
def convert_orig_tf1_checkpoint_to_pytorch(tf_checkpoint_path, convbert_config_file, pytorch_dump_path):
conf = ConvBertCon... | true | true |
f7083cb528dfbc4c395fa961f63b0a8b00653ae7 | 6,620 | py | Python | Pi1/DevBatchControlv0.1.py | jakehyvonen/BTSPython | 9580a04622226a30fea4d5cbd036c7f88a9b732d | [
"MIT"
] | null | null | null | Pi1/DevBatchControlv0.1.py | jakehyvonen/BTSPython | 9580a04622226a30fea4d5cbd036c7f88a9b732d | [
"MIT"
] | null | null | null | Pi1/DevBatchControlv0.1.py | jakehyvonen/BTSPython | 9580a04622226a30fea4d5cbd036c7f88a9b732d | [
"MIT"
] | null | null | null | from gpiozero import LED
from time import sleep
import socket
import serial
#low level IC control pins
led1 = LED(13) #A0 pin
led2 = LED(6) #A1 pin
led3 = LED(5) #A2 pin
led4 = LED(27) #led4+5 = device rest plate
led5 = LED(22)
###setup communication with C# host software
##TCP_IP = '169.254.130.182'
##TCP_PORT = 500... | 25.960784 | 55 | 0.60287 | from gpiozero import LED
from time import sleep
import socket
import serial
led1 = LED(13) led2 = LED(6) led3 = LED(5) led4 = LED(27) led5 = LED(22)
ser = serial.Serial(
port="/dev/ttyACM1",
baudrate=250000,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
... | true | true |
f7083ce629eebc31d6d0fe4a790c5a32b6ec69ca | 1,020 | py | Python | imagepy/menus/File/Import/roi_plg.py | adines/imagepy | d7cdf3273d25e06046626ef2ef9200b1846ea49a | [
"BSD-4-Clause"
] | 1 | 2019-02-22T03:09:24.000Z | 2019-02-22T03:09:24.000Z | imagepy/menus/File/Import/roi_plg.py | adines/imagepy | d7cdf3273d25e06046626ef2ef9200b1846ea49a | [
"BSD-4-Clause"
] | null | null | null | imagepy/menus/File/Import/roi_plg.py | adines/imagepy | d7cdf3273d25e06046626ef2ef9200b1846ea49a | [
"BSD-4-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on 12/21/2018
@author: BioinfoTongLI
"""
import numpy as np
import read_roi
from imagepy.core.engine import Free
from imagepy import IPy
from skimage.draw import polygon
class Plugin(Free):
"""load_ij_roi: use read_roi and th pass to shapely objects"""
title = 'Import Rois f... | 31.875 | 86 | 0.558824 | import numpy as np
import read_roi
from imagepy.core.engine import Free
from imagepy import IPy
from skimage.draw import polygon
class Plugin(Free):
title = 'Import Rois from IJ'
para = {'path': '', 'name': 'Undefined', 'width': 512, 'height': 512}
view = [(str, 'name', 'name', ''),
(int, 'wi... | true | true |
f7083d021a8246eb35e98c07308c8cc6808d8bec | 9,979 | py | Python | ertk/stats.py | bagustris/emotion | 5bd83d3ca8a6eb930f449b7a990fefd75d0c7d36 | [
"MIT"
] | 3 | 2020-11-03T14:54:22.000Z | 2021-04-12T12:23:10.000Z | ertk/stats.py | bagustris/emotion | 5bd83d3ca8a6eb930f449b7a990fefd75d0c7d36 | [
"MIT"
] | null | null | null | ertk/stats.py | bagustris/emotion | 5bd83d3ca8a6eb930f449b7a990fefd75d0c7d36 | [
"MIT"
] | 2 | 2020-12-03T06:21:59.000Z | 2021-01-16T04:47:12.000Z | from functools import partial
from typing import Callable, List, Union
import numpy as np
import pandas as pd
from scipy.stats import friedmanchisquare, rankdata
from sklearn.metrics.pairwise import pairwise_distances
from statsmodels.stats.libqsturng import qsturng
Matrix = List[List[float]]
def friedman_nemenyi(t... | 30.990683 | 88 | 0.585029 | from functools import partial
from typing import Callable, List, Union
import numpy as np
import pandas as pd
from scipy.stats import friedmanchisquare, rankdata
from sklearn.metrics.pairwise import pairwise_distances
from statsmodels.stats.libqsturng import qsturng
Matrix = List[List[float]]
def friedman_nemenyi(t... | true | true |
f7083e7be8c43bd2e80217c44c86601be9add0cd | 12,053 | py | Python | rdkit/Chem/Pharm2D/Utils.py | docking-org/rdk | 6eb710254f027b348a8e3089e6a92c3d40de0949 | [
"PostgreSQL"
] | 1 | 2019-01-23T06:02:24.000Z | 2019-01-23T06:02:24.000Z | rdkit/Chem/Pharm2D/Utils.py | Mike575/rdkit | 373a89021e478f878c6011a201e3fb8f4a122093 | [
"PostgreSQL"
] | null | null | null | rdkit/Chem/Pharm2D/Utils.py | Mike575/rdkit | 373a89021e478f878c6011a201e3fb8f4a122093 | [
"PostgreSQL"
] | 1 | 2022-03-30T03:22:10.000Z | 2022-03-30T03:22:10.000Z | #
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" utility functionality for ... | 25.590234 | 96 | 0.578611 | from __future__ import print_function, division
import itertools
nPointDistDict = {
2: ((0, 1), ),
3: ((0, 1), (0, 2), (1, 2)),
4: ((0, 1), (0, 2), (0, 3), (1, 2), (2, 3)),
5: ((0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (2, 3), (3, 4)),
6: ((0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (1, 2), (2, 3), (3, 4), (4, 5)... | true | true |
f7083e93a60d9d63b08a9b5da38bc8c394ece1f9 | 3,342 | py | Python | tickvaultpythonapi/parsing/predicate.py | TickSmith/tickvault-python-api | 712a8a27bbc1815414009a60c92344471f36b81f | [
"MIT"
] | 4 | 2018-02-12T14:05:46.000Z | 2019-08-14T15:48:16.000Z | tickvaultpythonapi/parsing/predicate.py | TickSmith/tickvault-python-api | 712a8a27bbc1815414009a60c92344471f36b81f | [
"MIT"
] | null | null | null | tickvaultpythonapi/parsing/predicate.py | TickSmith/tickvault-python-api | 712a8a27bbc1815414009a60c92344471f36b81f | [
"MIT"
] | 1 | 2020-01-14T11:12:02.000Z | 2020-01-14T11:12:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 TickSmith Corp.
#
# Licensed under the MIT License
#
# 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, ... | 31.528302 | 80 | 0.640036 |
import sys
from tickvaultpythonapi.parsing.operation import Operation, BaseOperation
class Predicate(object):
key = ""
operation = ""
value = ""
opClass = Operation()
def __init__(self, key, op, val):
self.key = key
self.operation = self.get_valid_op(op)
self.value = ... | true | true |
f7083ffe9154fa0150d4edfa7cf36e104d7b7b0f | 117,025 | py | Python | FINE/expansionModules/robustPipelineSizing.py | sdickler/FINE | 3114fd009e80a7eadacffe26bf5ff8e6a126ac61 | [
"MIT"
] | 34 | 2018-07-02T16:20:39.000Z | 2022-03-30T09:46:44.000Z | FINE/expansionModules/robustPipelineSizing.py | sdickler/FINE | 3114fd009e80a7eadacffe26bf5ff8e6a126ac61 | [
"MIT"
] | 19 | 2018-11-09T07:56:20.000Z | 2022-02-15T10:54:21.000Z | FINE/expansionModules/robustPipelineSizing.py | sdickler/FINE | 3114fd009e80a7eadacffe26bf5ff8e6a126ac61 | [
"MIT"
] | 42 | 2018-09-24T15:07:20.000Z | 2022-02-25T18:41:52.000Z | """
Last edited: January 20 2020
|br| @author: FINE Developer Team (FZJ IEK-3) \n\n
The approaches used are described in
Robinius et. al. (2019) "Robust Optimal Discrete Arc Sizing for Tree-Shaped Potential Networks"
and they are further developed with the help of
Theorem 10 of Labbé et. al. (2019) "Bookings in the Eu... | 49.356811 | 131 | 0.666678 | import pandas as pd
from FINE import utils
import networkx as nx
import math
import pyomo.environ as py
import warnings
from pyomo.opt import SolverFactory, SolverStatus, TerminationCondition
import numpy as np
import copy
from scipy.optimize import fsolve
import matplotlib.pyplot as plt
import matplotlib as mpl
import... | true | true |
f70842c6f7480d694d52953c9c6749a115190f85 | 9,830 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations_async/_subscriptions_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations_async/_subscriptions_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations_async/_subscriptions_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.279279 | 133 | 0.653713 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
fro... | true | true |
f70843497fc4ba407966c513c0e2afaa1534c821 | 1,544 | py | Python | python/array.py | itzsoumyadip/vs | acf32cd0bacb26e62854060e0acf5eb41b7a68c8 | [
"Unlicense"
] | 1 | 2019-07-05T04:27:05.000Z | 2019-07-05T04:27:05.000Z | python/array.py | itzsoumyadip/vs | acf32cd0bacb26e62854060e0acf5eb41b7a68c8 | [
"Unlicense"
] | null | null | null | python/array.py | itzsoumyadip/vs | acf32cd0bacb26e62854060e0acf5eb41b7a68c8 | [
"Unlicense"
] | null | null | null | from array import*
# in array all the value have to be in same type
# array in python , dont have fixed size means they are flexible
vls = array('i',[5,34,54,23,26,32,2]) ## i = unsigned int
# copying array
newArr = array(vls.typecode,(a for a in vls)) # fetch one value form vls and assigned... | 15.59596 | 98 | 0.612047 | from array import*
vls = array('i',[5,34,54,23,26,32,2])
newArr = array(vls.typecode,(a for a in vls))
for e in newArr:
print(e,end=" ")
print()
print(vls.buffer_info() )
for i in vls:
print(i)
print(vls[1])
while i<len(newArr):
print(newArr[i])
i+=1
print(vls.typ... | true | true |
f70843ebb0ecba18f71fe77e21d8117ca9a4ba19 | 3,809 | py | Python | drrn/drrn.py | ydai94/tdqn | 83c66263cb47016414dbe47ad3b252bb9e681ca8 | [
"MIT"
] | 22 | 2019-10-29T22:39:57.000Z | 2021-08-12T06:43:11.000Z | drrn/drrn.py | ydai94/tdqn | 83c66263cb47016414dbe47ad3b252bb9e681ca8 | [
"MIT"
] | 1 | 2021-04-13T13:57:00.000Z | 2021-04-13T13:57:00.000Z | drrn/drrn.py | ydai94/tdqn | 83c66263cb47016414dbe47ad3b252bb9e681ca8 | [
"MIT"
] | 11 | 2019-10-31T19:58:13.000Z | 2021-09-13T12:49:45.000Z | import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
from os.path import join as pjoin
from memory import ReplayMemory, Transition, State
from model import DRRN
from util import *
import logger
import sentencepiece as spm
device = torch.device("cuda" if torch.cuda.is_available() else "cpu"... | 37.712871 | 104 | 0.637438 | import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
from os.path import join as pjoin
from memory import ReplayMemory, Transition, State
from model import DRRN
from util import *
import logger
import sentencepiece as spm
device = torch.device("cuda" if torch.cuda.is_available() else "cpu"... | true | true |
f7084436e83db9a4637aafc8f104c1b71803c8ce | 93 | py | Python | ai_utils/knowledge/__init__.py | daniel-waruo/ai-utils | 6a32239b8eb9b611d3b693454e00aa5626d51e82 | [
"MIT"
] | null | null | null | ai_utils/knowledge/__init__.py | daniel-waruo/ai-utils | 6a32239b8eb9b611d3b693454e00aa5626d51e82 | [
"MIT"
] | null | null | null | ai_utils/knowledge/__init__.py | daniel-waruo/ai-utils | 6a32239b8eb9b611d3b693454e00aa5626d51e82 | [
"MIT"
] | null | null | null | """
This module has all the tools necessary for me to handle a knowledge logic problem
""" | 31 | 84 | 0.731183 | true | true | |
f70844978e398bc63fd41438f8070d8885c10a06 | 9,790 | py | Python | lib/spack/spack/test/llnl/util/filesystem.py | rtohid/spack | 6df57bb2d0619a22b0bb0a5028b7caef7f31e722 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | lib/spack/spack/test/llnl/util/filesystem.py | rtohid/spack | 6df57bb2d0619a22b0bb0a5028b7caef7f31e722 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 17 | 2018-09-20T18:32:50.000Z | 2019-12-04T16:58:12.000Z | lib/spack/spack/test/llnl/util/filesystem.py | rtohid/spack | 6df57bb2d0619a22b0bb0a5028b7caef7f31e722 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Tests for ``llnl/util/filesystem.py``"""
import llnl.util.filesystem as fs
import os
import stat
import pytest
@pyte... | 32.742475 | 79 | 0.631359 |
import llnl.util.filesystem as fs
import os
import stat
import pytest
@pytest.fixture()
def stage(tmpdir_factory):
s = tmpdir_factory.mktemp('filesystem_test')
with s.as_cwd():
fs.touchp('source/1')
fs.touchp('source/a/b/2')
fs.touchp('source/a/b/3')
fs.touchp('sour... | true | true |
f70844acde7c3e99d4f4ea1b217c618aa5a8b698 | 9,285 | py | Python | mnogoznal/wsd.py | dustalov/mnogoznal | bacea1576d31e0d2ad5456159a57950899a116f6 | [
"MIT"
] | 10 | 2017-08-11T08:47:25.000Z | 2018-04-07T15:13:37.000Z | mnogoznal/wsd.py | dustalov/mnogoznal | bacea1576d31e0d2ad5456159a57950899a116f6 | [
"MIT"
] | 1 | 2019-10-31T17:59:49.000Z | 2019-10-31T17:59:49.000Z | mnogoznal/wsd.py | nlpub/watasense | bacea1576d31e0d2ad5456159a57950899a116f6 | [
"MIT"
] | 1 | 2018-02-18T15:03:24.000Z | 2018-02-18T15:03:24.000Z | import abc
import csv
from collections import namedtuple, defaultdict, OrderedDict, Counter
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics.pairwise import cosine_similarity as sim
from sklearn.pipeline import Pi... | 30.146104 | 116 | 0.596446 | import abc
import csv
from collections import namedtuple, defaultdict, OrderedDict, Counter
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics.pairwise import cosine_similarity as sim
from sklearn.pipeline import Pi... | true | true |
f708476a2cc43393cd5ba3aa180c3286fe8d674e | 2,712 | py | Python | run.py | nyamzy/Password_Manager | 6f109b2ace6eef23148ae42be0b62124c9fb5e37 | [
"Unlicense"
] | null | null | null | run.py | nyamzy/Password_Manager | 6f109b2ace6eef23148ae42be0b62124c9fb5e37 | [
"Unlicense"
] | null | null | null | run.py | nyamzy/Password_Manager | 6f109b2ace6eef23148ae42be0b62124c9fb5e37 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
from password_manager import User, Credentials
def create_user(fname, lname, uname, email, password):
'''
Function that creates a new user
'''
new_user = User(fname, lname, uname, email, password)
return new_user
def save_users(user):
'''
Function that saves a new user
'''
use... | 23.179487 | 142 | 0.620575 | from password_manager import User, Credentials
def create_user(fname, lname, uname, email, password):
new_user = User(fname, lname, uname, email, password)
return new_user
def save_users(user):
user.save_user()
def del_user(user):
user.delete_contact()
def find_user(username):
return User.find_by_username... | true | true |
f708481f6e02fece16961a60a2c795ef64ec141f | 10,933 | py | Python | project/systems/ecgresnet_ensemble_auxout.py | HabibMrad/uncertainty | 1646a9b07d1179045dd0375149250d5ac7501004 | [
"Apache-2.0"
] | 1 | 2022-01-04T23:25:06.000Z | 2022-01-04T23:25:06.000Z | project/systems/ecgresnet_ensemble_auxout.py | HabibMrad/uncertainty | 1646a9b07d1179045dd0375149250d5ac7501004 | [
"Apache-2.0"
] | null | null | null | project/systems/ecgresnet_ensemble_auxout.py | HabibMrad/uncertainty | 1646a9b07d1179045dd0375149250d5ac7501004 | [
"Apache-2.0"
] | null | null | null | import sys
import os
import torch
import pandas as pd
import datetime
from argparse import ArgumentParser
import numpy as np
from torch import nn, optim
import torch.nn.functional as F
from torch.utils.data import DataLoader, random_split
from icecream import ic
import pytorch_lightning as pl
from pytorch_lightning.me... | 44.084677 | 156 | 0.668892 | import sys
import os
import torch
import pandas as pd
import datetime
from argparse import ArgumentParser
import numpy as np
from torch import nn, optim
import torch.nn.functional as F
from torch.utils.data import DataLoader, random_split
from icecream import ic
import pytorch_lightning as pl
from pytorch_lightning.me... | true | true |
f70848729c6f81574d502884536d2da9fba9af60 | 7,069 | py | Python | hubploy/auth.py | tjcrone/hubploy | 1767689c5277400a473b9f239a851f75051d8240 | [
"BSD-3-Clause"
] | null | null | null | hubploy/auth.py | tjcrone/hubploy | 1767689c5277400a473b9f239a851f75051d8240 | [
"BSD-3-Clause"
] | null | null | null | hubploy/auth.py | tjcrone/hubploy | 1767689c5277400a473b9f239a851f75051d8240 | [
"BSD-3-Clause"
] | null | null | null | """
Setup authentication from various providers
"""
import json
import os
import subprocess
import shutil
from hubploy.config import get_config
from ruamel.yaml import YAML
yaml = YAML(typ='rt')
def registry_auth(deployment):
"""
Do appropriate registry authentication for given deployment
"""
config... | 28.735772 | 82 | 0.625407 | import json
import os
import subprocess
import shutil
from hubploy.config import get_config
from ruamel.yaml import YAML
yaml = YAML(typ='rt')
def registry_auth(deployment):
config = get_config(deployment)
if 'images' in config and 'registry' in config['images']:
registry = config['images']['regist... | true | true |
f708492421111894a9ec36490aef33347ccb2b29 | 2,055 | py | Python | examples/simple/app.py | cdpath/fastapi_login | 4e9cde923b60a6852a24b34292e2a10f4333ced3 | [
"MIT"
] | null | null | null | examples/simple/app.py | cdpath/fastapi_login | 4e9cde923b60a6852a24b34292e2a10f4333ced3 | [
"MIT"
] | null | null | null | examples/simple/app.py | cdpath/fastapi_login | 4e9cde923b60a6852a24b34292e2a10f4333ced3 | [
"MIT"
] | null | null | null | import uuid
from fastapi import Depends, FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from fastapi.security import OAuth2PasswordRequestForm
from pydantic import BaseSettings, BaseModel, UUID4
from fastapi_login import LoginManager
from fastapi_login.exceptions import InvalidCredentialsException
... | 24.759036 | 92 | 0.709976 | import uuid
from fastapi import Depends, FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from fastapi.security import OAuth2PasswordRequestForm
from pydantic import BaseSettings, BaseModel, UUID4
from fastapi_login import LoginManager
from fastapi_login.exceptions import InvalidCredentialsException
... | true | true |
f7084a1fac2c524a1eab21ba916d5d53938c4ebb | 20,361 | py | Python | python/ray/tune/tests/test_function_api.py | jacobhjkim/ray | 936cb5929c455102d5638ff5d59c80c4ae94770f | [
"Apache-2.0"
] | null | null | null | python/ray/tune/tests/test_function_api.py | jacobhjkim/ray | 936cb5929c455102d5638ff5d59c80c4ae94770f | [
"Apache-2.0"
] | 43 | 2021-02-27T08:02:40.000Z | 2022-03-26T07:02:23.000Z | python/ray/tune/tests/test_function_api.py | jacobhjkim/ray | 936cb5929c455102d5638ff5d59c80c4ae94770f | [
"Apache-2.0"
] | null | null | null | import json
import os
import sys
import shutil
import tempfile
import unittest
import ray
import ray.cloudpickle as cloudpickle
from ray.rllib import _register_all
from ray import tune
from ray.tune.logger import NoopLogger
from ray.tune.utils.trainable import TrainableUtil
from ray.tune.function_runner import with_p... | 37.916201 | 79 | 0.602475 | import json
import os
import sys
import shutil
import tempfile
import unittest
import ray
import ray.cloudpickle as cloudpickle
from ray.rllib import _register_all
from ray import tune
from ray.tune.logger import NoopLogger
from ray.tune.utils.trainable import TrainableUtil
from ray.tune.function_runner import with_p... | true | true |
f7084adeb4e464e80a35a46eed5e75ed2ec77fdd | 12,350 | py | Python | cinder/api/v2/volumes.py | traghavendra/cinder-train | 49af592c61da3216c04f5771b8ebf0927c5ce1c8 | [
"Apache-2.0"
] | null | null | null | cinder/api/v2/volumes.py | traghavendra/cinder-train | 49af592c61da3216c04f5771b8ebf0927c5ce1c8 | [
"Apache-2.0"
] | 28 | 2017-08-17T14:46:05.000Z | 2022-03-29T12:42:12.000Z | cinder/api/v2/volumes.py | traghavendra/cinder-train | 49af592c61da3216c04f5771b8ebf0927c5ce1c8 | [
"Apache-2.0"
] | 3 | 2017-04-27T16:11:40.000Z | 2020-02-12T21:27:00.000Z | # Copyright 2011 Justin Santa Barbara
# 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 requ... | 38.235294 | 79 | 0.629393 |
from oslo_config import cfg
from oslo_log import log as logging
from oslo_log import versionutils
from oslo_utils import uuidutils
from six.moves import http_client
import webob
from webob import exc
from cinder.api import api_utils
from cinder.api import common
from cinder.api.contrib import scheduler_hints
from c... | true | true |
f7084c889dba9a7baf5467baf350f88f62040e86 | 3,180 | py | Python | pyscript/torch/utils.py | takuto0831/Competition-utils | c738e199c6a771a0c58b9cd237660bb76b4be4fb | [
"MIT"
] | null | null | null | pyscript/torch/utils.py | takuto0831/Competition-utils | c738e199c6a771a0c58b9cd237660bb76b4be4fb | [
"MIT"
] | null | null | null | pyscript/torch/utils.py | takuto0831/Competition-utils | c738e199c6a771a0c58b9cd237660bb76b4be4fb | [
"MIT"
] | null | null | null | import os
import random
import subprocess
import numpy as np
import torch
import time
try:
import torch_xla
import torch_xla.core.xla_model as xm
XLA = True
except ModuleNotFoundError:
XLA = False
def freeze_module(module):
for i, param in enumerate(module.parameters()):
param.requires_gra... | 28.909091 | 81 | 0.60283 | import os
import random
import subprocess
import numpy as np
import torch
import time
try:
import torch_xla
import torch_xla.core.xla_model as xm
XLA = True
except ModuleNotFoundError:
XLA = False
def freeze_module(module):
for i, param in enumerate(module.parameters()):
param.requires_gra... | true | true |
f7084ca79cb058035b4d0b6e1c6f2ddb82b38e82 | 1,272 | py | Python | resources_portal/__init__.py | AlexsLemonade/python-flask-demo | 247780aa5ecfd6ce9b876514f96b2048549857d2 | [
"BSD-3-Clause"
] | null | null | null | resources_portal/__init__.py | AlexsLemonade/python-flask-demo | 247780aa5ecfd6ce9b876514f96b2048549857d2 | [
"BSD-3-Clause"
] | null | null | null | resources_portal/__init__.py | AlexsLemonade/python-flask-demo | 247780aa5ecfd6ce9b876514f96b2048549857d2 | [
"BSD-3-Clause"
] | null | null | null | import os
import resources_portal.models # noqa
from flask import Flask
from flask_migrate import Migrate
from flask_restful import Api
from resources_portal.db import db
from resources_portal.views import user
migrate = Migrate()
def initialize_routes(api: Api):
api.add_resource(user.UsersApi, "/users")
a... | 24.461538 | 96 | 0.706761 | import os
import resources_portal.models from flask import Flask
from flask_migrate import Migrate
from flask_restful import Api
from resources_portal.db import db
from resources_portal.views import user
migrate = Migrate()
def initialize_routes(api: Api):
api.add_resource(user.UsersApi, "/users")
api.add_... | true | true |
f7084d77def231fe4c7eb0e32eecd4fdc2733e9a | 37,936 | py | Python | Packs/IntSight/Integrations/IntSight/IntSight.py | AVAILOTECH/x2o-demisto-content | b5d4c182833fd7314592c9984d078b2df170cf77 | [
"MIT"
] | null | null | null | Packs/IntSight/Integrations/IntSight/IntSight.py | AVAILOTECH/x2o-demisto-content | b5d4c182833fd7314592c9984d078b2df170cf77 | [
"MIT"
] | null | null | null | Packs/IntSight/Integrations/IntSight/IntSight.py | AVAILOTECH/x2o-demisto-content | b5d4c182833fd7314592c9984d078b2df170cf77 | [
"MIT"
] | null | null | null | from CommonServerPython import *
reload(sys)
sys.setdefaultencoding('utf-8') # pylint: disable=E1101
requests.packages.urllib3.disable_warnings()
URL = demisto.getParam('server')
if URL[-1] != '/':
URL += '/'
if not demisto.getParam('proxy'):
del os.environ['HTTP_PROXY']
del os.environ['HTTPS_PROXY']
... | 38.319192 | 120 | 0.62297 | from CommonServerPython import *
reload(sys)
sys.setdefaultencoding('utf-8')
requests.packages.urllib3.disable_warnings()
URL = demisto.getParam('server')
if URL[-1] != '/':
URL += '/'
if not demisto.getParam('proxy'):
del os.environ['HTTP_PROXY']
del os.environ['HTTPS_PROXY']
del os.environ['http_... | true | true |
f7084dda96df5fbdb4c6f4b4ce402acbfe593566 | 851 | py | Python | SupportLibraries/base_helpers.py | Abhilash04/SeleniumPythonHybridFramework | 277db41afed6b24ec2c8e9b579925ad3da75e937 | [
"MIT"
] | 9 | 2018-11-14T09:19:22.000Z | 2021-05-18T15:18:45.000Z | SupportLibraries/base_helpers.py | Abhilash04/SeleniumPythonHybridFramework | 277db41afed6b24ec2c8e9b579925ad3da75e937 | [
"MIT"
] | null | null | null | SupportLibraries/base_helpers.py | Abhilash04/SeleniumPythonHybridFramework | 277db41afed6b24ec2c8e9b579925ad3da75e937 | [
"MIT"
] | 4 | 2018-09-18T16:56:37.000Z | 2020-07-02T11:57:21.000Z | """
This module contains common reusable functions.
"""
from traceback import print_stack
from configparser import ConfigParser
from SupportLibraries.ui_helpers import UIHelpers
class BaseHelpers(UIHelpers):
"""
This class includes basic reusable base_helpers.
"""
def __init__(self, driver):
... | 23.638889 | 69 | 0.633373 |
from traceback import print_stack
from configparser import ConfigParser
from SupportLibraries.ui_helpers import UIHelpers
class BaseHelpers(UIHelpers):
def __init__(self, driver):
super().__init__(driver)
self.driver = driver
def load_properties_file(self):
config = None
tr... | true | true |
f7084ecbce9cfc66335bac95d0a736f1ac69da7d | 6,856 | py | Python | airflow-service-mpack/common-services/AIRFLOW/1.10.0/package/scripts/airflow_setup.py | hapadong/ambari-airflow-mpack | 92d0345c18e0a345cc9e9493d926ec0e4cc98980 | [
"Apache-2.0"
] | null | null | null | airflow-service-mpack/common-services/AIRFLOW/1.10.0/package/scripts/airflow_setup.py | hapadong/ambari-airflow-mpack | 92d0345c18e0a345cc9e9493d926ec0e4cc98980 | [
"Apache-2.0"
] | null | null | null | airflow-service-mpack/common-services/AIRFLOW/1.10.0/package/scripts/airflow_setup.py | hapadong/ambari-airflow-mpack | 92d0345c18e0a345cc9e9493d926ec0e4cc98980 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys, os, pwd, grp, signal, time, base64
from resource_management import *
from resource_management.core.exceptions import Fail
from resource_management.core.logger import Logger
from resource_management.core.resources.system import Execute, Directory, File
from resource_management.core.shel... | 37.67033 | 240 | 0.777275 | import sys, os, pwd, grp, signal, time, base64
from resource_management import *
from resource_management.core.exceptions import Fail
from resource_management.core.logger import Logger
from resource_management.core.resources.system import Execute, Directory, File
from resource_management.core.shell import call
from res... | true | true |
f7084ee37b0683bda4a3495022074260d110fd35 | 2,715 | py | Python | closure_linter/testutil.py | Announcement/closure-linter | de66a7ca6ca0ca248d55d567aad96b7e0657be85 | [
"Apache-2.0"
] | 123 | 2015-07-03T08:39:12.000Z | 2021-11-14T09:28:14.000Z | tools/closure_linter/closure_linter/testutil.py | flyover/node | 8e743a77e48256444c3637f8282e4cad35da508c | [
"Artistic-2.0"
] | 25 | 2015-06-22T10:40:55.000Z | 2019-05-06T12:01:53.000Z | tools/closure_linter/closure_linter/testutil.py | flyover/node | 8e743a77e48256444c3637f8282e4cad35da508c | [
"Artistic-2.0"
] | 36 | 2015-07-03T15:17:13.000Z | 2020-10-13T16:34:28.000Z | #!/usr/bin/env python
#
# Copyright 2012 The Closure Linter 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
#... | 28.578947 | 75 | 0.755064 |
__author__ = ('nnaze@google.com (Nathan Naze)')
import StringIO
from closure_linter import ecmametadatapass
from closure_linter import javascriptstatetracker
from closure_linter import javascripttokenizer
def TokenizeSource(source):
if isinstance(source, basestring):
source = StringIO.StringIO(source)
... | true | true |
f7084f20a1b8eee1a82a652ae308751180897d7a | 55 | py | Python | ma_gym/envs/traffic_junction_hard/__init__.py | joosephook/ma-gym | 535df389326a5b7b389d652e775b7b8bd2e5d778 | [
"Apache-2.0"
] | null | null | null | ma_gym/envs/traffic_junction_hard/__init__.py | joosephook/ma-gym | 535df389326a5b7b389d652e775b7b8bd2e5d778 | [
"Apache-2.0"
] | null | null | null | ma_gym/envs/traffic_junction_hard/__init__.py | joosephook/ma-gym | 535df389326a5b7b389d652e775b7b8bd2e5d778 | [
"Apache-2.0"
] | null | null | null | from .traffic_junction_hard import TrafficJunctionHard
| 27.5 | 54 | 0.909091 | from .traffic_junction_hard import TrafficJunctionHard
| true | true |
f708501fdbd0f30992b089b0874da1cba328ec3c | 3,596 | py | Python | server/settings/environments/development.py | Islast/AutSPACEs | 2392e4ee731c44661059b35cc205613697c782d6 | [
"MIT"
] | null | null | null | server/settings/environments/development.py | Islast/AutSPACEs | 2392e4ee731c44661059b35cc205613697c782d6 | [
"MIT"
] | null | null | null | server/settings/environments/development.py | Islast/AutSPACEs | 2392e4ee731c44661059b35cc205613697c782d6 | [
"MIT"
] | null | null | null | """
This file contains all the settings that defines the development server.
SECURITY WARNING: don't run with debug turned on in production!
"""
import logging
from typing import List
from server.settings.components import config
from server.settings.components.common import INSTALLED_APPS, MIDDLEWARE
# Setting the... | 27.450382 | 82 | 0.691324 |
import logging
from typing import List
from server.settings.components import config
from server.settings.components.common import INSTALLED_APPS, MIDDLEWARE
DEBUG = True
ALLOWED_HOSTS = [
config('DOMAIN_NAME'),
'localhost',
'0.0.0.0', '127.0.0.1',
'[::1]',
]
INSTALLED_APPS += (
'debug_... | true | true |
f7085056f732870808a5fc11c2c6e7523990d5b1 | 594 | py | Python | tools/generate_taint_models/parameter.py | sthagen/facebook-pyre-check | cea188088c9632b10e0d0a658a8f1954f19413cd | [
"MIT"
] | null | null | null | tools/generate_taint_models/parameter.py | sthagen/facebook-pyre-check | cea188088c9632b10e0d0a658a8f1954f19413cd | [
"MIT"
] | null | null | null | tools/generate_taint_models/parameter.py | sthagen/facebook-pyre-check | cea188088c9632b10e0d0a658a8f1954f19413cd | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from enum import auto, Enum
from typing import NamedTuple, Optional
class Parameter(NamedTuple):
class Kind(Enum):
ARG = auto(... | 24.75 | 65 | 0.654882 |
from enum import auto, Enum
from typing import NamedTuple, Optional
class Parameter(NamedTuple):
class Kind(Enum):
ARG = auto()
VARARG = auto()
KWARG = auto()
name: str
annotation: Optional[str]
kind: Kind
def __eq__(self, other: "Parameter") -> bool:
if not isin... | true | true |
f70850b2252c5eeef4ef80bf3767acdfeb2562eb | 481 | py | Python | tests/test_app/models.py | enderlabs/django-encrypted-json | 148dae03001e1731b40e12bb9cac749c7edf1caa | [
"MIT"
] | null | null | null | tests/test_app/models.py | enderlabs/django-encrypted-json | 148dae03001e1731b40e12bb9cac749c7edf1caa | [
"MIT"
] | null | null | null | tests/test_app/models.py | enderlabs/django-encrypted-json | 148dae03001e1731b40e12bb9cac749c7edf1caa | [
"MIT"
] | 1 | 2019-03-07T10:01:47.000Z | 2019-03-07T10:01:47.000Z | from django.db import models
from django_encrypted_json.fields import EncryptedValueJsonField
# Create your models here.
class TestModel(models.Model):
json = EncryptedValueJsonField(default={})
optional_json = EncryptedValueJsonField(blank=True, null=True)
partial_encrypt = EncryptedValueJsonField(
... | 32.066667 | 66 | 0.75052 | from django.db import models
from django_encrypted_json.fields import EncryptedValueJsonField
class TestModel(models.Model):
json = EncryptedValueJsonField(default={})
optional_json = EncryptedValueJsonField(blank=True, null=True)
partial_encrypt = EncryptedValueJsonField(
blank=True, null=True,... | true | true |
f70850ca483a2cf7d2e8eca3f7141764aebd44b9 | 6,705 | py | Python | demo/runners/aerlingusold.py | MySupersuit/DecentralisedIdentityVaxPassport | 9dd2168c56335f821a38048559b56726718660ce | [
"Apache-2.0"
] | null | null | null | demo/runners/aerlingusold.py | MySupersuit/DecentralisedIdentityVaxPassport | 9dd2168c56335f821a38048559b56726718660ce | [
"Apache-2.0"
] | null | null | null | demo/runners/aerlingusold.py | MySupersuit/DecentralisedIdentityVaxPassport | 9dd2168c56335f821a38048559b56726718660ce | [
"Apache-2.0"
] | null | null | null | import asyncio
import json
import logging
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # noqa
from runners.support.agent import DemoAgent, default_genesis_txns
from runners.support.utils import (
log_json,
log_msg,
log_status,
log_timer,
prompt... | 30.616438 | 88 | 0.567338 | import asyncio
import json
import logging
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from runners.support.agent import DemoAgent, default_genesis_txns
from runners.support.utils import (
log_json,
log_msg,
log_status,
log_timer,
prompt,
p... | true | true |
f70850e2708d1f5805cad2a1aec3a5796e69da47 | 1,636 | py | Python | src/moduels/gui/Combo_EngineList.py | HaujetZhao/Caps_Writer | f2b2038a2c0984a1d356f024cbac421fe594601a | [
"MIT"
] | 234 | 2020-07-10T11:23:09.000Z | 2022-03-31T09:41:40.000Z | src/moduels/gui/Combo_EngineList.py | HaujetZhao/Caps_Writer | f2b2038a2c0984a1d356f024cbac421fe594601a | [
"MIT"
] | 9 | 2020-07-11T08:31:11.000Z | 2022-03-01T04:30:08.000Z | src/moduels/gui/Combo_EngineList.py | HaujetZhao/Caps_Writer | f2b2038a2c0984a1d356f024cbac421fe594601a | [
"MIT"
] | 23 | 2020-07-14T08:58:44.000Z | 2022-03-17T06:38:10.000Z | # -*- coding: UTF-8 -*-
import os, sqlite3
from PySide2.QtWidgets import QComboBox
from moduels.component.NormalValue import 常量
# 添加预设对话框
class Combo_EngineList(QComboBox):
def __init__(self):
super().__init__()
self.initElements() # 先初始化各个控件
self.initSlots() # 再将各个控件连接到信号槽
self.... | 26.819672 | 93 | 0.556235 |
import os, sqlite3
from PySide2.QtWidgets import QComboBox
from moduels.component.NormalValue import 常量
class Combo_EngineList(QComboBox):
def __init__(self):
super().__init__()
self.initElements() self.initSlots() self.initLayouts() self.initValues()
def initEleme... | true | true |
f7085159f268f42e1dab4ca0c38dc0a46286f7cd | 4,538 | py | Python | app/eg003_list_envelopes.py | AaronWDS/eg-03-python-auth-code-grant | 6cb1694cbbb8cdbf166fda282e81886fd8380e5e | [
"MIT"
] | null | null | null | app/eg003_list_envelopes.py | AaronWDS/eg-03-python-auth-code-grant | 6cb1694cbbb8cdbf166fda282e81886fd8380e5e | [
"MIT"
] | null | null | null | app/eg003_list_envelopes.py | AaronWDS/eg-03-python-auth-code-grant | 6cb1694cbbb8cdbf166fda282e81886fd8380e5e | [
"MIT"
] | null | null | null | """Example 003: List envelopes in the user's account"""
from flask import render_template, url_for, redirect, session, flash, request
from os import path
import json
from app import app, ds_config, views
from datetime import datetime, timedelta
from docusign_esign import *
from docusign_esign.rest import ApiException
... | 40.159292 | 110 | 0.617232 |
from flask import render_template, url_for, redirect, session, flash, request
from os import path
import json
from app import app, ds_config, views
from datetime import datetime, timedelta
from docusign_esign import *
from docusign_esign.rest import ApiException
eg = "eg003"
def controller():
if request.method ... | true | true |
f70851cea744e28815e15729e639c2a5608b56a3 | 6,283 | py | Python | prov_vo/migrations/0006_add_useddescription_wasgeneratedbydescription.py | kristinriebe/django-prov-vo | 5bd86eb58833fe591004e6ef431b2b3deae7a62c | [
"Apache-2.0"
] | 1 | 2018-12-11T05:53:55.000Z | 2018-12-11T05:53:55.000Z | prov_vo/migrations/0006_add_useddescription_wasgeneratedbydescription.py | kristinriebe/django-prov-vo | 5bd86eb58833fe591004e6ef431b2b3deae7a62c | [
"Apache-2.0"
] | null | null | null | prov_vo/migrations/0006_add_useddescription_wasgeneratedbydescription.py | kristinriebe/django-prov-vo | 5bd86eb58833fe591004e6ef431b2b3deae7a62c | [
"Apache-2.0"
] | 1 | 2021-06-23T13:09:05.000Z | 2021-06-23T13:09:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-01-22 12:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('prov_vo', '0005_add_activitydescription_entitydescription')... | 48.330769 | 202 | 0.629954 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('prov_vo', '0005_add_activitydescription_entitydescription'),
]
operations = [
migrations.CreateModel(
n... | true | true |
f7085209ff1d42f87982b89f116312cf7f730323 | 3,399 | py | Python | findfine/trip/models.py | muchu1983/findfine | b2255db6327324e89b914fd93a81f7ea5eac6f64 | [
"BSD-3-Clause"
] | 1 | 2017-05-25T20:25:20.000Z | 2017-05-25T20:25:20.000Z | findfine/trip/models.py | muchu1983/104_findfine | b2255db6327324e89b914fd93a81f7ea5eac6f64 | [
"BSD-3-Clause"
] | null | null | null | findfine/trip/models.py | muchu1983/104_findfine | b2255db6327324e89b914fd93a81f7ea5eac6f64 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2016, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
from django.db import models
from account.models import UserAccount
# 行程資料
class Trip(models.Model):
#來源網站
strSource = mo... | 31.766355 | 102 | 0.714034 | from django.db import models
from account.models import UserAccount
class Trip(models.Model):
strSource = models.CharField(max_length=255, null=False)
strOriginUrl = models.CharField(db_index=True, max_length=255, null=False)
strImageUrl = models.TextField(null=False)
strUpdateStatus = ... | true | true |
f70852dd2aefe681a6e4b9449b993aa22610a832 | 5,612 | py | Python | test/modules/http2/env.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 2,529 | 2015-01-02T11:52:53.000Z | 2022-03-30T19:54:27.000Z | test/modules/http2/env.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 133 | 2015-04-21T05:50:45.000Z | 2022-03-30T14:23:40.000Z | test/modules/http2/env.py | tititiou36/httpd | 1348607c00ba58ce371f2f8ecb08abf610227043 | [
"Apache-2.0"
] | 1,113 | 2015-01-01T14:47:02.000Z | 2022-03-29T16:47:18.000Z | import inspect
import logging
import os
import re
import subprocess
from typing import Dict, Any
from pyhttpd.certs import CertificateSpec
from pyhttpd.conf import HttpdConf
from pyhttpd.env import HttpdTestEnv, HttpdTestSetup
log = logging.getLogger(__name__)
class H2TestSetup(HttpdTestSetup):
def __init__(se... | 39.521127 | 107 | 0.586066 | import inspect
import logging
import os
import re
import subprocess
from typing import Dict, Any
from pyhttpd.certs import CertificateSpec
from pyhttpd.conf import HttpdConf
from pyhttpd.env import HttpdTestEnv, HttpdTestSetup
log = logging.getLogger(__name__)
class H2TestSetup(HttpdTestSetup):
def __init__(se... | true | true |
f70858bd78db6d504be4468aaef1b4b5b49cd875 | 6,392 | py | Python | models/GNN/GIN.py | mwcvitkovic/Supervised-Learning-on-Relational-Databases-with-GNNs | 57195ccab62d23dcbcac1a317f8a9811a9fd6cb5 | [
"MIT"
] | 44 | 2020-02-07T12:44:25.000Z | 2022-03-31T21:57:08.000Z | models/GNN/GIN.py | mwcvitkovic/Supervised-Learning-on-Relational-Databases-with-GNNs | 57195ccab62d23dcbcac1a317f8a9811a9fd6cb5 | [
"MIT"
] | 2 | 2020-02-07T03:54:15.000Z | 2020-05-07T13:21:29.000Z | models/GNN/GIN.py | mwcvitkovic/Supervised-Learning-on-Relational-Databases-with-GNNs | 57195ccab62d23dcbcac1a317f8a9811a9fd6cb5 | [
"MIT"
] | 10 | 2020-02-23T07:34:55.000Z | 2021-07-25T18:34:40.000Z | from dgl import BatchedDGLGraph
from dgl.nn.pytorch.conv import GINConv
from torch import nn
from models.GNN.GNNModelBase import GNNModelBase
from models.utils import TypeConditionalLinear
class GIN(GNNModelBase):
"""
Graph Isomorphism Network as described in https://arxiv.org/pdf/1810.00826.pdf
"""
... | 44.082759 | 117 | 0.532697 | from dgl import BatchedDGLGraph
from dgl.nn.pytorch.conv import GINConv
from torch import nn
from models.GNN.GNNModelBase import GNNModelBase
from models.utils import TypeConditionalLinear
class GIN(GNNModelBase):
def __init__(self, n_apply_func_layers, aggregator_type, init_eps, learn_eps, **kwargs):
s... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.