hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7086e93ee1b53d1996a2bb80c4d634d913be312 | 1,136 | py | Python | diarypro/diarypro/urls.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/urls.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/urls.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | """diarypro URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 36.645161 | 77 | 0.71831 | from django.contrib import admin
from django.urls import path
from diaryapp import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('',views.home_view, name='home'),
path('event/',views.diary_view, name='create event'),
... | true | true |
f708705384503395a107c1f697f4709d5586f514 | 27 | py | Python | dataset_generator/learning/imitation/iil-dagger/algorithms/__init__.py | rjean/duckie-segmentation | 5e720e1a96ef61c4560823030549ac1d5d16e2a4 | [
"Apache-2.0"
] | 1 | 2021-02-03T02:23:34.000Z | 2021-02-03T02:23:34.000Z | dataset_generator/learning/imitation/iil-dagger/algorithms/__init__.py | rjean/mobile-segmentation | 5e720e1a96ef61c4560823030549ac1d5d16e2a4 | [
"Apache-2.0"
] | null | null | null | dataset_generator/learning/imitation/iil-dagger/algorithms/__init__.py | rjean/mobile-segmentation | 5e720e1a96ef61c4560823030549ac1d5d16e2a4 | [
"Apache-2.0"
] | null | null | null | from .dagger import DAgger
| 13.5 | 26 | 0.814815 | from .dagger import DAgger
| true | true |
f708712d2f1c53c86869ad65b24cc045d49f7d91 | 16,068 | py | Python | src/biotite/sequence/io/gff/file.py | padix-key/biopython2experimental | d88ab895469f0ab0911056cc5fa16dde5d07fd63 | [
"BSD-3-Clause"
] | null | null | null | src/biotite/sequence/io/gff/file.py | padix-key/biopython2experimental | d88ab895469f0ab0911056cc5fa16dde5d07fd63 | [
"BSD-3-Clause"
] | null | null | null | src/biotite/sequence/io/gff/file.py | padix-key/biopython2experimental | d88ab895469f0ab0911056cc5fa16dde5d07fd63 | [
"BSD-3-Clause"
] | null | null | null | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.sequence.io.gff"
__author__ = "Patrick Kunzmann"
__all__ = ["GFFFile"]
import copy
import string
from urllib.parse import quote, unquote
import... | 37.023041 | 131 | 0.545681 |
__name__ = "biotite.sequence.io.gff"
__author__ = "Patrick Kunzmann"
__all__ = ["GFFFile"]
import copy
import string
from urllib.parse import quote, unquote
import warnings
from ....file import TextFile, InvalidFileError
from ...annotation import Location
_NOT_QUOTED = "".join(
[char for char in string.pun... | true | true |
f708725b346619d5750d7805256a417ecccab059 | 3,436 | py | Python | tests/st/auto_monad/test_auto_monad_layer.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/auto_monad/test_auto_monad_layer.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/auto_monad/test_auto_monad_layer.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.902439 | 107 | 0.659488 |
from tqdm import tqdm
import numpy as np
import mindspore as ms
import mindspore.nn as nn
from mindspore.dataset import NumpySlicesDataset
from mindspore import context, Tensor
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend")
class AutoEncoderTrainNetwork(nn.Cell):
def __init__(s... | true | true |
f708726a644aec2224002f120ebd80965a6d2684 | 2,156 | py | Python | Receipt.py | michael-canaran/python-practice | cdd99db85be39e5b6d3241fe84f2501fba64f567 | [
"MIT"
] | null | null | null | Receipt.py | michael-canaran/python-practice | cdd99db85be39e5b6d3241fe84f2501fba64f567 | [
"MIT"
] | null | null | null | Receipt.py | michael-canaran/python-practice | cdd99db85be39e5b6d3241fe84f2501fba64f567 | [
"MIT"
] | 1 | 2020-01-05T06:49:03.000Z | 2020-01-05T06:49:03.000Z | from datetime import *
class Receipt:
def __init__(self, member_number):
# Initialize the receipt as a list for future modifications (adding and removing items)
self.member_items = []
self.member_number = member_number
self.total = 0.0
self.total_tax = 0.0
#... | 39.925926 | 98 | 0.579314 | from datetime import *
class Receipt:
def __init__(self, member_number):
self.member_items = []
self.member_number = member_number
self.total = 0.0
self.total_tax = 0.0
def add_item(self, item):
self.member_items.append(item)
item_pric... | true | true |
f708727a0170e03a37c3bf2596268f06778aa9bf | 15,458 | py | Python | tests/hikari/internal/test_routes.py | Lunarmagpie/hikari | 3f4fed67f76c655845d379066f9d192e7dffd0b0 | [
"MIT"
] | null | null | null | tests/hikari/internal/test_routes.py | Lunarmagpie/hikari | 3f4fed67f76c655845d379066f9d192e7dffd0b0 | [
"MIT"
] | null | null | null | tests/hikari/internal/test_routes.py | Lunarmagpie/hikari | 3f4fed67f76c655845d379066f9d192e7dffd0b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation t... | 47.709877 | 119 | 0.630677 |
import mock
import pytest
from hikari import files
from hikari.internal import routes
from tests.hikari import hikari_test_helpers
class TestCompiledRoute:
@pytest.fixture()
def compiled_route(self):
return routes.CompiledRoute(
major_param_hash="abc123", route=mock.M... | true | true |
f70872dd11437754839b9ea7a1f1e156077dfca1 | 3,023 | py | Python | linked-list/linked_list.py | souparnabose99/data-structures-python | a98dd261644a59438fb75d7dc2b21cf159d5c41b | [
"MIT"
] | null | null | null | linked-list/linked_list.py | souparnabose99/data-structures-python | a98dd261644a59438fb75d7dc2b21cf159d5c41b | [
"MIT"
] | null | null | null | linked-list/linked_list.py | souparnabose99/data-structures-python | a98dd261644a59438fb75d7dc2b21cf159d5c41b | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data):
self.data = data
self.next_node = None
class LinkedList:
def __init__(self):
self.head = None
self.no_of_nodes = 0
# O(1) for insertion at the start of LL
def insert_at_start(self, data):
self.no_of_nodes = sel... | 26.752212 | 75 | 0.604036 | class Node:
def __init__(self, data):
self.data = data
self.next_node = None
class LinkedList:
def __init__(self):
self.head = None
self.no_of_nodes = 0
def insert_at_start(self, data):
self.no_of_nodes = self.no_of_nodes + 1
new_node = No... | true | true |
f70873fcb4f81fac7415f87caf48b171944f2b25 | 4,959 | py | Python | src/reporter/query_NTNENA.py | cnoelle/ngsi-timeseries-api | 77ed420c0a7532bcc13d941c0402f457cc40407a | [
"MIT"
] | null | null | null | src/reporter/query_NTNENA.py | cnoelle/ngsi-timeseries-api | 77ed420c0a7532bcc13d941c0402f457cc40407a | [
"MIT"
] | null | null | null | src/reporter/query_NTNENA.py | cnoelle/ngsi-timeseries-api | 77ed420c0a7532bcc13d941c0402f457cc40407a | [
"MIT"
] | null | null | null | from exceptions.exceptions import NGSIUsageError
from utils.jsondict import lookup_string_match
from flask import request
from reporter.reporter import _validate_query_params
from translators.crate import CrateTranslatorInstance
import logging
from .geo_query_handler import handle_geo_query
def query_NTNENA(id_=None,... | 35.676259 | 111 | 0.461182 | from exceptions.exceptions import NGSIUsageError
from utils.jsondict import lookup_string_match
from flask import request
from reporter.reporter import _validate_query_params
from translators.crate import CrateTranslatorInstance
import logging
from .geo_query_handler import handle_geo_query
def query_NTNENA(id_=None,... | true | true |
f708740d1be7649c7d1e4311e0c6417e165b7497 | 5,009 | py | Python | lab4/text_recognizer/models/line_cnn.py | Agyey/fsdl-text-recognizer-2021-labs | 4bd85042ab9f6decd78849bb655c197cc13ffc11 | [
"MIT"
] | 1 | 2021-03-16T11:00:42.000Z | 2021-03-16T11:00:42.000Z | lab4/text_recognizer/models/line_cnn.py | Agyey/fsdl-text-recognizer-2021-labs | 4bd85042ab9f6decd78849bb655c197cc13ffc11 | [
"MIT"
] | null | null | null | lab4/text_recognizer/models/line_cnn.py | Agyey/fsdl-text-recognizer-2021-labs | 4bd85042ab9f6decd78849bb655c197cc13ffc11 | [
"MIT"
] | null | null | null | from typing import Any, Dict
import argparse
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
CONV_DIM = 64
FC_DIM = 128
WINDOW_WIDTH = 28
WINDOW_STRIDE = 28
class ConvBlock(nn.Module):
"""
Simple 3x3 conv with padding size 1 (to leave the input size unchanged), followed by a Re... | 34.544828 | 124 | 0.5556 | from typing import Any, Dict
import argparse
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
CONV_DIM = 64
FC_DIM = 128
WINDOW_WIDTH = 28
WINDOW_STRIDE = 28
class ConvBlock(nn.Module):
def __init__(self, input_channels: int, output_channels: int, kernel_size: int = 3, stride: int ... | true | true |
f708744ed8de3fca2afaf6f8806fb9da1e654edb | 3,110 | py | Python | murano-7.0.0/contrib/plugins/cloudify_plugin/murano_cloudify_plugin/cloudify_client.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 91 | 2015-04-26T16:05:03.000Z | 2021-12-28T07:12:33.000Z | murano-7.0.0/contrib/plugins/cloudify_plugin/murano_cloudify_plugin/cloudify_client.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | murano-7.0.0/contrib/plugins/cloudify_plugin/murano_cloudify_plugin/cloudify_client.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 61 | 2015-05-19T22:56:34.000Z | 2021-06-01T05:38:53.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 34.94382 | 79 | 0.688424 |
import threading
import time
import cloudify_rest_client
import cloudify_rest_client.exceptions as cloudify_exceptions
from murano.dsl import dsl
from oslo_config import cfg as config
from yaql.language import specs
from yaql.language import yaqltypes
import cfg
CONF = config.CONF
archive_upload_lock =... | true | true |
f708746a2f008b37d6cbf4a6b54de754b18a4b02 | 744 | py | Python | get_some_food/users/forms.py | asergeenko/get_some_food | a9cfc776193287d2f375437420e985961688d6ed | [
"MIT"
] | null | null | null | get_some_food/users/forms.py | asergeenko/get_some_food | a9cfc776193287d2f375437420e985961688d6ed | [
"MIT"
] | null | null | null | get_some_food/users/forms.py | asergeenko/get_some_food | a9cfc776193287d2f375437420e985961688d6ed | [
"MIT"
] | null | null | null | from django.contrib.auth import forms as admin_forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
User = get_user_model()
class UserChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
model = User
class UserCreati... | 28.615385 | 78 | 0.645161 | from django.contrib.auth import forms as admin_forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
User = get_user_model()
class UserChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
model = User
class UserCreati... | true | true |
f7087490f6a7e5fd6864626d44154053d111408a | 998 | py | Python | Keyless Keyed Transpositional Cipher/compare index and list.py | AshwinBalaji52/Mobile-Computing-and-Security | a0404f0835169f3496f0b8be4ea20f953503b0a0 | [
"MIT"
] | null | null | null | Keyless Keyed Transpositional Cipher/compare index and list.py | AshwinBalaji52/Mobile-Computing-and-Security | a0404f0835169f3496f0b8be4ea20f953503b0a0 | [
"MIT"
] | null | null | null | Keyless Keyed Transpositional Cipher/compare index and list.py | AshwinBalaji52/Mobile-Computing-and-Security | a0404f0835169f3496f0b8be4ea20f953503b0a0 | [
"MIT"
] | null | null | null | from random import shuffle
counter=1
#index = None
index = []
#indexlist = []
decrypt_list = []
intermediate = []
words = ['B', 'A', 'L', 'K','J','I']
newwords = words.copy() # Copy words
shuffle(newwords) # Shuffle newwords
for i in range(len(words)):
for j in range(len(newwords)):
if(words[i... | 22.681818 | 72 | 0.643287 | from random import shuffle
counter=1
index = []
decrypt_list = []
intermediate = []
words = ['B', 'A', 'L', 'K','J','I']
newwords = words.copy()
shuffle(newwords)
for i in range(len(words)):
for j in range(len(newwords)):
if(words[i]==newwords[j]):
index.append(j)
print("Origin... | true | true |
f70875724f8a4b9bfc1141e67d5af7e864ca6a2f | 637 | py | Python | data/compute_rates.py | addschile/qtps | 3220af82d409526463dc4fe9e4ea869d655c0bd8 | [
"MIT"
] | null | null | null | data/compute_rates.py | addschile/qtps | 3220af82d409526463dc4fe9e4ea869d655c0bd8 | [
"MIT"
] | null | null | null | data/compute_rates.py | addschile/qtps | 3220af82d409526463dc4fe9e4ea869d655c0bd8 | [
"MIT"
] | null | null | null | import numpy as np
from sys import argv
tobs = int(argv[1])
p0 = np.zeros(10)
p2 = np.zeros(10)
p1 = np.zeros(10)
Zab = np.zeros(10)
rate = np.zeros(10)
for i in range(10):
da = np.loadtxt('tobs%d/reweighted_hist_%d.dat'%(tobs,i))
p0[i] = np.exp(-da[-2,1])
p2[i] = np.exp(-da[-1,1])
p1[i] = np.exp(-da[-... | 21.965517 | 65 | 0.596546 | import numpy as np
from sys import argv
tobs = int(argv[1])
p0 = np.zeros(10)
p2 = np.zeros(10)
p1 = np.zeros(10)
Zab = np.zeros(10)
rate = np.zeros(10)
for i in range(10):
da = np.loadtxt('tobs%d/reweighted_hist_%d.dat'%(tobs,i))
p0[i] = np.exp(-da[-2,1])
p2[i] = np.exp(-da[-1,1])
p1[i] = np.exp(-da[-... | true | true |
f70876132e6e96ac713b78db6125d8884610491b | 1,428 | py | Python | pythonforandroid/recipes/shapely/__init__.py | surbhicis/python-for-android | f8472bd3048b72e06ab5defea2f51ffc5c5e7bed | [
"MIT"
] | 4 | 2020-05-19T01:49:51.000Z | 2021-11-08T09:41:05.000Z | pythonforandroid/recipes/shapely/__init__.py | basharbme/python-for-android | f8472bd3048b72e06ab5defea2f51ffc5c5e7bed | [
"MIT"
] | 6 | 2020-01-31T18:04:48.000Z | 2021-06-05T10:53:55.000Z | pythonforandroid/recipes/shapely/__init__.py | basharbme/python-for-android | f8472bd3048b72e06ab5defea2f51ffc5c5e7bed | [
"MIT"
] | 8 | 2017-07-20T05:34:04.000Z | 2021-08-03T08:21:32.000Z | from pythonforandroid.recipe import CythonRecipe
from os.path import join
class ShapelyRecipe(CythonRecipe):
version = '1.7a1'
url = 'https://github.com/Toblerity/Shapely/archive/{version}.tar.gz'
depends = ['setuptools', 'libgeos']
# Actually, this recipe seems to compile/install fine for python2, b... | 35.7 | 77 | 0.686275 | from pythonforandroid.recipe import CythonRecipe
from os.path import join
class ShapelyRecipe(CythonRecipe):
version = '1.7a1'
url = 'https://github.com/Toblerity/Shapely/archive/{version}.tar.gz'
depends = ['setuptools', 'libgeos']
conflicts = ['python2']
call_hostpython_via_targ... | true | true |
f708761adcd1ea623e38e155f985cfb34bf530d5 | 8,240 | py | Python | tools/test.py | TillBeemelmanns/OpenPCDet | b7553c879d0ba36477931efe07a55adbc39823b9 | [
"Apache-2.0"
] | null | null | null | tools/test.py | TillBeemelmanns/OpenPCDet | b7553c879d0ba36477931efe07a55adbc39823b9 | [
"Apache-2.0"
] | null | null | null | tools/test.py | TillBeemelmanns/OpenPCDet | b7553c879d0ba36477931efe07a55adbc39823b9 | [
"Apache-2.0"
] | null | null | null | import os
import torch
from tensorboardX import SummaryWriter
import time
import glob
import re
import datetime
import argparse
from pathlib import Path
import torch.distributed as dist
from pcdet.datasets import build_dataloader
from pcdet.models import build_network
from pcdet.utils import common_utils
from pcdet.con... | 42.916667 | 120 | 0.681917 | import os
import torch
from tensorboardX import SummaryWriter
import time
import glob
import re
import datetime
import argparse
from pathlib import Path
import torch.distributed as dist
from pcdet.datasets import build_dataloader
from pcdet.models import build_network
from pcdet.utils import common_utils
from pcdet.con... | true | true |
f708766a0136ddf59a2750659fdfb2ffb6f801b9 | 100 | py | Python | scripts/factory_methods.py | dkorenci/ner_cro | 86b8040e1f5e92ff89f53f6ca5825b944afa210b | [
"Apache-2.0"
] | null | null | null | scripts/factory_methods.py | dkorenci/ner_cro | 86b8040e1f5e92ff89f53f6ca5825b944afa210b | [
"Apache-2.0"
] | null | null | null | scripts/factory_methods.py | dkorenci/ner_cro | 86b8040e1f5e92ff89f53f6ca5825b944afa210b | [
"Apache-2.0"
] | null | null | null | from scripts.bilstm_tagger import bilstm_tagger
from scripts.bilstm_tagger_model import build_model
| 33.333333 | 51 | 0.9 | from scripts.bilstm_tagger import bilstm_tagger
from scripts.bilstm_tagger_model import build_model
| true | true |
f708774dd84ff1e94a2e5b0a67504f9c44ba42f3 | 55,175 | py | Python | env/lib/python3.6/site-packages/pandas/core/panel.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 4 | 2018-11-27T01:35:30.000Z | 2022-01-27T01:17:11.000Z | env/lib/python3.6/site-packages/pandas/core/panel.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 3 | 2020-03-24T15:38:23.000Z | 2021-02-02T21:44:18.000Z | env/lib/python3.6/site-packages/pandas/core/panel.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 3 | 2019-12-24T18:46:58.000Z | 2021-09-04T11:57:13.000Z | """
Contains data structures designed for manipulating panel (3-dimensional) data
"""
# pylint: disable=E1103,W0231,W0212,W0621
from __future__ import division
import warnings
import numpy as np
from pandas.types.cast import (_infer_dtype_from_scalar,
_possibly_cast_item)
from pandas.t... | 34.965146 | 79 | 0.557698 |
from __future__ import division
import warnings
import numpy as np
from pandas.types.cast import (_infer_dtype_from_scalar,
_possibly_cast_item)
from pandas.types.common import (is_integer, is_list_like,
is_string_like, is_scalar)
from pandas.types.mis... | true | true |
f7087785207517cbb4605c1c30cb4178a14909ce | 888 | py | Python | main/migrations/0002_auto_20200225_1930.py | MexsonFernandes/CustomYoloV3 | 0acde7613d3b202859b8bab21b9c3ee5432a61bf | [
"MIT"
] | null | null | null | main/migrations/0002_auto_20200225_1930.py | MexsonFernandes/CustomYoloV3 | 0acde7613d3b202859b8bab21b9c3ee5432a61bf | [
"MIT"
] | 4 | 2021-06-04T23:17:43.000Z | 2021-09-22T19:06:48.000Z | main/migrations/0002_auto_20200225_1930.py | MexsonFernandes/DjanYolo | ccdaa3ee45c55b8cc9ff00342d9d44f293e8500c | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-25 19:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main', '0001_initial'),
... | 30.62069 | 125 | 0.650901 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main', '0001_initial'),
]
operations = [
migrations.Ad... | true | true |
f70877d517388341ba4068c28d5fd24a0f6420ac | 3,440 | py | Python | h5nastran/f06_reader.py | EmanueleCannizzaro/h5nastran | a4ac2e8e0600332a553048a79393f96bd090b2ea | [
"MIT",
"BSD-3-Clause"
] | 2 | 2019-09-18T06:37:13.000Z | 2020-05-26T11:58:03.000Z | h5nastran/f06_reader.py | EmanueleCannizzaro/h5nastran | a4ac2e8e0600332a553048a79393f96bd090b2ea | [
"MIT",
"BSD-3-Clause"
] | null | null | null | h5nastran/f06_reader.py | EmanueleCannizzaro/h5nastran | a4ac2e8e0600332a553048a79393f96bd090b2ea | [
"MIT",
"BSD-3-Clause"
] | 2 | 2018-08-11T16:46:37.000Z | 2022-03-06T18:19:33.000Z | from __future__ import print_function, absolute_import
from six import iteritems, iterkeys, itervalues
from six.moves import range
from _file_reader import FileReader
from f06_table import F06Table
class _DummyTable(object):
def __init__(self):
self.header = []
self.data = []
self.line_n... | 26.259542 | 68 | 0.571512 | from __future__ import print_function, absolute_import
from six import iteritems, iterkeys, itervalues
from six.moves import range
from _file_reader import FileReader
from f06_table import F06Table
class _DummyTable(object):
def __init__(self):
self.header = []
self.data = []
self.line_n... | true | true |
f70878ad9644433e31d9c6e041bb1c6ce2f75b22 | 33,195 | py | Python | fastlmm/inference/fastlmm_predictor.py | eric-czech/FaST-LMM | 497ac732f0cb25e328282cff42045afb70a99076 | [
"Apache-2.0"
] | null | null | null | fastlmm/inference/fastlmm_predictor.py | eric-czech/FaST-LMM | 497ac732f0cb25e328282cff42045afb70a99076 | [
"Apache-2.0"
] | null | null | null | fastlmm/inference/fastlmm_predictor.py | eric-czech/FaST-LMM | 497ac732f0cb25e328282cff42045afb70a99076 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function #Python 2 & 3 compatibility
from __future__ import absolute_import
import numpy as np
import logging
import unittest
import os
import scipy.linalg as LA
import time
from pysnptools.snpreader import Bed,Pheno
from pysnptools.snpreader import SnpData,SnpReader
from pysnptools.kernel... | 57.83101 | 323 | 0.674318 | from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import logging
import unittest
import os
import scipy.linalg as LA
import time
from pysnptools.snpreader import Bed,Pheno
from pysnptools.snpreader import SnpData,SnpReader
from pysnptools.kernelreader import KernelNpz
fro... | true | true |
f70878f0501f62bdd0dcc9249e96933340f8f1f2 | 1,680 | py | Python | practice/bst.py | haandol/dojo | c29dc54614bdfaf79eb4862ed9fa25974a0f5654 | [
"MIT"
] | null | null | null | practice/bst.py | haandol/dojo | c29dc54614bdfaf79eb4862ed9fa25974a0f5654 | [
"MIT"
] | null | null | null | practice/bst.py | haandol/dojo | c29dc54614bdfaf79eb4862ed9fa25974a0f5654 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
self.height = 1
def insert(node, val):
if not node:
return Node(val)
if val <= node.val:
node.left = insert(node.left, val)
else:
node.right = insert(node.rig... | 18.26087 | 54 | 0.567262 | class Node:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
self.height = 1
def insert(node, val):
if not node:
return Node(val)
if val <= node.val:
node.left = insert(node.left, val)
else:
node.right = insert(node.rig... | true | true |
f708790a5ceb4681c6c0ae68240047ad1efa7ac7 | 3,205 | py | Python | homeassistant/components/broadlink/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 2 | 2021-01-29T02:52:01.000Z | 2021-05-15T04:23:18.000Z | homeassistant/components/broadlink/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 68 | 2020-07-23T07:13:53.000Z | 2022-03-31T06:01:48.000Z | homeassistant/components/broadlink/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 7 | 2021-03-20T12:34:01.000Z | 2021-12-02T10:13:52.000Z | """Support for Broadlink sensors."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassis... | 31.732673 | 86 | 0.699844 | import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassistant.const import CONF_HOST, PERCENTA... | true | true |
f7087a5a75b94c165bd14d3b048d7d86623fcbe8 | 2,745 | py | Python | blackmamba/script/toggle_comments.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | null | null | null | blackmamba/script/toggle_comments.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | null | null | null | blackmamba/script/toggle_comments.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | null | null | null | #!python3
import re
from blackmamba.system import Pythonista
def _comment_line(line, hash_prefix=''):
stripped = line.strip()
if stripped.startswith('#'):
return line
if not stripped:
return hash_prefix + '# \n'
return hash_prefix + '# ' + line[len(hash_prefix):]
_UNCOMMENT_RE = ... | 22.5 | 106 | 0.63133 |
import re
from blackmamba.system import Pythonista
def _comment_line(line, hash_prefix=''):
stripped = line.strip()
if stripped.startswith('#'):
return line
if not stripped:
return hash_prefix + '# \n'
return hash_prefix + '# ' + line[len(hash_prefix):]
_UNCOMMENT_RE = re.compil... | true | true |
f7087a9747ae148c97e1d86f50ba57ad6830aec3 | 33,897 | py | Python | tests/test_primary.py | kerwindong/uptane | 113be3c8a1f05a021625e8b73316696063bbae7e | [
"MIT"
] | 135 | 2016-11-22T17:54:01.000Z | 2022-03-20T09:34:16.000Z | tests/test_primary.py | kerwindong/uptane | 113be3c8a1f05a021625e8b73316696063bbae7e | [
"MIT"
] | 182 | 2016-11-28T16:34:09.000Z | 2020-11-24T15:05:34.000Z | tests/test_primary.py | kerwindong/uptane | 113be3c8a1f05a021625e8b73316696063bbae7e | [
"MIT"
] | 52 | 2016-11-23T02:26:57.000Z | 2022-01-22T14:33:55.000Z | """
<Program Name>
test_primary.py
<Purpose>
Unit testing for uptane/clients/primary.py
<Copyright>
See LICENSE for licensing information.
"""
from __future__ import unicode_literals
import uptane # Import before TUF modules; may change tuf.conf values.
import unittest
import os.path
import time
import copy
i... | 36.764642 | 150 | 0.728354 | from __future__ import unicode_literals
import uptane
import unittest
import os.path
import time
import copy
import shutil
import hashlib
import iso8601
from six.moves.urllib.error import URLError
import tuf
import tuf.formats
import tuf.conf
import tuf.client.updater
import uptane.formats
import uptane.clients.... | true | true |
f7087addb93a393392d9800dc38093aa66036065 | 10,705 | py | Python | reegis/mobility.py | jnettels/reegis | fe50c124aa041b9faa494611cba6b833675115e4 | [
"MIT"
] | null | null | null | reegis/mobility.py | jnettels/reegis | fe50c124aa041b9faa494611cba6b833675115e4 | [
"MIT"
] | null | null | null | reegis/mobility.py | jnettels/reegis | fe50c124aa041b9faa494611cba6b833675115e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Calculate the mobility demand.
SPDX-FileCopyrightText: 2016-2019 Uwe Krien <krien@uni-bremen.de>
SPDX-License-Identifier: MIT
"""
__copyright__ = "Uwe Krien <krien@uni-bremen.de>"
__license__ = "MIT"
import os
import pandas as pd
from collections import namedtuple
from reegis import geo... | 27.877604 | 79 | 0.616534 |
__copyright__ = "Uwe Krien <krien@uni-bremen.de>"
__license__ = "MIT"
import os
import pandas as pd
from collections import namedtuple
from reegis import geometries, config as cfg, tools, energy_balance
def format_kba_table(filename, sheet):
df = pd.read_excel(filename, sheet, skiprows=7, header=[0, 1]... | true | true |
f7087b51d7ba26204dd3feb9b980fba59565ce46 | 5,841 | py | Python | configs/body/2d_kpt_sview_rgb_img/associative_embedding/aic/higherhrnet_w32_aic_512x512.py | robertpreda/mmpose | 42d00d7b5742ce89105e73dec1b72b4fea2cacde | [
"Apache-2.0"
] | 1,775 | 2020-07-10T01:20:01.000Z | 2022-03-31T16:31:50.000Z | configs/body/2d_kpt_sview_rgb_img/associative_embedding/aic/higherhrnet_w32_aic_512x512.py | ly015/mmpose | 2b4a5cf3197cb14832cb6b7ecb883c76084d7131 | [
"Apache-2.0"
] | 1,021 | 2020-07-11T11:40:24.000Z | 2022-03-31T14:32:26.000Z | configs/body/2d_kpt_sview_rgb_img/associative_embedding/aic/higherhrnet_w32_aic_512x512.py | ly015/mmpose | 2b4a5cf3197cb14832cb6b7ecb883c76084d7131 | [
"Apache-2.0"
] | 477 | 2020-07-11T11:27:51.000Z | 2022-03-31T09:42:25.000Z | _base_ = ['../../../../_base_/datasets/aic.py']
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=50)
evaluation = dict(interval=50, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
opti... | 28.773399 | 77 | 0.574046 | _base_ = ['../../../../_base_/datasets/aic.py']
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=50)
evaluation = dict(interval=50, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
opti... | true | true |
f7087ca213f3e2731d33f44af33711a2e82b380c | 386 | py | Python | KOMORANPy/training/trainer.py | shineware/KOMORANPy | b8c1904b42a0bdfcd26c4c85cb37cd8cb48ffb6a | [
"Apache-2.0"
] | 2 | 2021-07-02T04:41:03.000Z | 2021-12-08T10:26:20.000Z | KOMORANPy/training/trainer.py | shineware/KOMORANPy | b8c1904b42a0bdfcd26c4c85cb37cd8cb48ffb6a | [
"Apache-2.0"
] | 1 | 2021-08-24T16:09:00.000Z | 2021-08-24T16:09:00.000Z | KOMORANPy/training/trainer.py | shineware/KOMORANPy | b8c1904b42a0bdfcd26c4c85cb37cd8cb48ffb6a | [
"Apache-2.0"
] | 1 | 2021-07-25T10:35:56.000Z | 2021-07-25T10:35:56.000Z | from KOMORANPy.training.model_builder import ModelBuilder
# corpus_builder = CorpusBuilder()
# # todo : 트레이닝 데이터 위치 ( 실제로는 바이너리 파일만 제공 될 예정 )
# corpus_builder.build_path("/Users/shinjunsoo/shineware/data/komoran_training_data", ".refine.txt")
# corpus_builder.save("corpus_build")
model_builder = ModelBuilder()
model_... | 35.090909 | 100 | 0.782383 | from KOMORANPy.training.model_builder import ModelBuilder
er.build_path("corpus_build")
model_builder.save("../model")
| true | true |
f7087ce4c035b1fb1de188116f3653f00a4e8ccb | 581 | py | Python | web/project/settings/production.py | borzunov/django-forum | 37ee43327575e59a4f7e1fcaa9f3a1c0de08d2b3 | [
"MIT"
] | null | null | null | web/project/settings/production.py | borzunov/django-forum | 37ee43327575e59a4f7e1fcaa9f3a1c0de08d2b3 | [
"MIT"
] | null | null | null | web/project/settings/production.py | borzunov/django-forum | 37ee43327575e59a4f7e1fcaa9f3a1c0de08d2b3 | [
"MIT"
] | null | null | null | from .common import *
DEBUG = False
ALLOWED_HOSTS = [os.environ['HOST']]
EMAIL_HOST = os.environ['EMAIL_HOST']
EMAIL_PORT = int(os.environ['EMAIL_PORT'])
EMAIL_HOST_USER = os.environ['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
EMAIL_USE_TLS = True
LOGGING = {
'version': 1,
... | 18.741935 | 55 | 0.580034 | from .common import *
DEBUG = False
ALLOWED_HOSTS = [os.environ['HOST']]
EMAIL_HOST = os.environ['EMAIL_HOST']
EMAIL_PORT = int(os.environ['EMAIL_PORT'])
EMAIL_HOST_USER = os.environ['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
EMAIL_USE_TLS = True
LOGGING = {
'version': 1,
... | true | true |
f7087d2d98dd995de906a86e6eeae12f9b9f9d50 | 2,840 | py | Python | chembl_webresource_client/new_client.py | RowAnalytics/chembl_webresource_client | 74dc4cb463a118cff8be949a3acf79f0d43e1625 | [
"Apache-2.0"
] | 1 | 2019-08-06T02:14:02.000Z | 2019-08-06T02:14:02.000Z | chembl_webresource_client/new_client.py | RowAnalytics/chembl_webresource_client | 74dc4cb463a118cff8be949a3acf79f0d43e1625 | [
"Apache-2.0"
] | null | null | null | chembl_webresource_client/new_client.py | RowAnalytics/chembl_webresource_client | 74dc4cb463a118cff8be949a3acf79f0d43e1625 | [
"Apache-2.0"
] | null | null | null | __author__ = 'mnowotka'
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import requests
import requests_cache
from chembl_webresource_client.spore_client import Client, make_spore_function
from chembl_webresource_client.query_set import QuerySet
from chembl_webresource_... | 39.444444 | 127 | 0.549648 | __author__ = 'mnowotka'
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import requests
import requests_cache
from chembl_webresource_client.spore_client import Client, make_spore_function
from chembl_webresource_client.query_set import QuerySet
from chembl_webresource_... | true | true |
f7087e3040b02607a04724ec8594d793d799f809 | 1,140 | py | Python | app/platforms/country_map_update.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | app/platforms/country_map_update.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | app/platforms/country_map_update.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | import pickle
from appcore.services import Factory
from platforms.base_platform import BasePlatform
from platforms.helpers.mysql_connection import MysqlConnection
class CountryMapUpdate(BasePlatform):
API_URL = 'my.sql.server'
DB_SETTINGS = {
'hostname': API_URL,
'username': 'db_user',
... | 29.230769 | 104 | 0.636842 | import pickle
from appcore.services import Factory
from platforms.base_platform import BasePlatform
from platforms.helpers.mysql_connection import MysqlConnection
class CountryMapUpdate(BasePlatform):
API_URL = 'my.sql.server'
DB_SETTINGS = {
'hostname': API_URL,
'username': 'db_user',
... | true | true |
f7087efe256dff2d6a4ec38f5d6ad75443d254a4 | 645 | py | Python | DQM/L1TMonitorClient/python/L1EmulatorObjHfBitCountsQualityTests_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | DQM/L1TMonitorClient/python/L1EmulatorObjHfBitCountsQualityTests_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | DQM/L1TMonitorClient/python/L1EmulatorObjHfBitCountsQualityTests_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | # quality tests for L1 HfBitCounts trigger objects
import FWCore.ParameterSet.Config as cms
l1EmulatorObjHfBitCountsQualityTests = cms.EDAnalyzer("QualityTester",
qtList=cms.untracked.FileInPath('DQM/L1TMonitorClient/data/L1EmulatorObjHfBitCountsQualityTests.xml'),
QualityTestPrescaler=cms.untracked.int32(1)... | 37.941176 | 106 | 0.789147 |
import FWCore.ParameterSet.Config as cms
l1EmulatorObjHfBitCountsQualityTests = cms.EDAnalyzer("QualityTester",
qtList=cms.untracked.FileInPath('DQM/L1TMonitorClient/data/L1EmulatorObjHfBitCountsQualityTests.xml'),
QualityTestPrescaler=cms.untracked.int32(1),
getQualityTestsFromFile=cms.untracked.bool(T... | true | true |
f7087f18674824aa39489d7b07d80db3e4b0e9b8 | 543 | py | Python | tests/test_renderer.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 17 | 2021-07-29T08:26:08.000Z | 2022-03-26T23:26:38.000Z | tests/test_renderer.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 37 | 2021-07-28T08:19:23.000Z | 2021-09-24T17:31:07.000Z | tests/test_renderer.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 3 | 2021-09-14T10:54:51.000Z | 2022-01-04T15:37:35.000Z | from adia.sequence import Module
from adia.renderer import ModulePlan, ItemStartPlan, ItemEndPlan, LEFT, RIGHT
def test_moduleplan():
p = ModulePlan(Module('foo'))
assert repr(p) == 'ModulePlan: foo'
def test_itemplans():
class Item:
def __repr__(self):
return 'foo -> bar'
item ... | 25.857143 | 77 | 0.609576 | from adia.sequence import Module
from adia.renderer import ModulePlan, ItemStartPlan, ItemEndPlan, LEFT, RIGHT
def test_moduleplan():
p = ModulePlan(Module('foo'))
assert repr(p) == 'ModulePlan: foo'
def test_itemplans():
class Item:
def __repr__(self):
return 'foo -> bar'
item ... | true | true |
f70880fce66d165efef7e7785145b657a31e1092 | 8,699 | py | Python | tests/test_sflow.py | venkatmahalingam/sonic-swss | d9f28b64255db54310d3398119f13dfb3203f311 | [
"Apache-2.0"
] | 1 | 2021-09-01T07:10:04.000Z | 2021-09-01T07:10:04.000Z | tests/test_sflow.py | venkatmahalingam/sonic-swss | d9f28b64255db54310d3398119f13dfb3203f311 | [
"Apache-2.0"
] | null | null | null | tests/test_sflow.py | venkatmahalingam/sonic-swss | d9f28b64255db54310d3398119f13dfb3203f311 | [
"Apache-2.0"
] | null | null | null | import time
class TestSflow:
speed_rate_table = {
"400000": "400000",
"200000": "200000",
"100000": "100000",
"50000": "50000",
"40000": "40000",
"25000": "25000",
"10000": "10000",
"1000": "1000"
}
def setup_sflow(self, dvs):
self.ad... | 45.784211 | 133 | 0.697092 | import time
class TestSflow:
speed_rate_table = {
"400000": "400000",
"200000": "200000",
"100000": "100000",
"50000": "50000",
"40000": "40000",
"25000": "25000",
"10000": "10000",
"1000": "1000"
}
def setup_sflow(self, dvs):
self.ad... | true | true |
f708832eb4bf7df5624f7937c92fc996b2938f06 | 9,117 | py | Python | command.py | vapier/git-repo | a2e1854e0015f3335959e08ee1aa817fcb8779d9 | [
"Apache-2.0"
] | 1 | 2021-03-24T01:51:50.000Z | 2021-03-24T01:51:50.000Z | command.py | vapier/git-repo | a2e1854e0015f3335959e08ee1aa817fcb8779d9 | [
"Apache-2.0"
] | null | null | null | command.py | vapier/git-repo | a2e1854e0015f3335959e08ee1aa817fcb8779d9 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2008 The Android Open Source Project
#
# 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 ... | 31.546713 | 86 | 0.666338 |
import os
import optparse
import platform
import re
import sys
from event_log import EventLog
from error import NoSuchProjectError
from error import InvalidProjectGroupsError
WORKER_BATCH_SIZE = 32
DEFAULT_LOCAL_JOBS = min(os.cpu_count(), 8)
class Command(object):
common = False
event_... | true | true |
f708844850409e8b816eb505e866c0d4f24940d2 | 2,400 | py | Python | tutorials/cdr/utils.py | eloriundo/snorkel | 746374b94c1558357ecb5bc07927dcc453239b3e | [
"Apache-2.0"
] | 2 | 2019-01-08T02:30:35.000Z | 2019-03-13T07:00:34.000Z | tutorials/cdr/utils.py | sduttap16/snorkel | bbbc1a38295d9411dbb792777e7d834865c0fd63 | [
"Apache-2.0"
] | null | null | null | tutorials/cdr/utils.py | sduttap16/snorkel | bbbc1a38295d9411dbb792777e7d834865c0fd63 | [
"Apache-2.0"
] | 2 | 2018-12-01T17:10:01.000Z | 2018-12-28T09:16:41.000Z | import bz2
from six.moves.cPickle import load
from string import punctuation
def offsets_to_token(left, right, offset_array, lemmas, punc=set(punctuation)):
token_start, token_end = None, None
for i, c in enumerate(offset_array):
if left >= c:
token_start = i
if c > right and toke... | 37.5 | 79 | 0.585417 | import bz2
from six.moves.cPickle import load
from string import punctuation
def offsets_to_token(left, right, offset_array, lemmas, punc=set(punctuation)):
token_start, token_end = None, None
for i, c in enumerate(offset_array):
if left >= c:
token_start = i
if c > right and toke... | true | true |
f70884914a35420087f57ef29fe00e211e674b21 | 219 | py | Python | misc/udp_sender2.py | RyanC1681/RCAI1122 | c9683110b58c255a7a78d880ff73df7ff2329405 | [
"Apache-2.0"
] | 18 | 2020-10-16T00:38:55.000Z | 2022-03-03T06:01:49.000Z | misc/udp_sender2.py | RyanC1681/RCAI1122 | c9683110b58c255a7a78d880ff73df7ff2329405 | [
"Apache-2.0"
] | 20 | 2020-07-23T03:50:50.000Z | 2021-11-09T04:00:26.000Z | misc/udp_sender2.py | RyanC1681/RCAI1122 | c9683110b58c255a7a78d880ff73df7ff2329405 | [
"Apache-2.0"
] | 140 | 2019-11-20T22:46:02.000Z | 2022-03-29T13:26:17.000Z | import cv2
import numpy as np
import socket
if __name__ == '__main__':
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = 12345
while True:
s.sendto(b'hello world', ("192.168.1.10", 8001))
| 21.9 | 56 | 0.6621 | import cv2
import numpy as np
import socket
if __name__ == '__main__':
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = 12345
while True:
s.sendto(b'hello world', ("192.168.1.10", 8001))
| true | true |
f70885a0c1f0e264313599ed4882bcdc4fbd90cc | 6,207 | py | Python | qcfractal/services/service_util.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/services/service_util.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/services/service_util.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | """
Utilities and base functions for Services.
"""
import abc
import datetime
from typing import Any, Dict, List, Optional, Set, Tuple
from pydantic import validator
from qcelemental.models import ComputeError
from ..interface.models import ObjectId, ProtoModel
from ..interface.models.rest_models import TaskQueuePOS... | 28.213636 | 97 | 0.585629 |
import abc
import datetime
from typing import Any, Dict, List, Optional, Set, Tuple
from pydantic import validator
from qcelemental.models import ComputeError
from ..interface.models import ObjectId, ProtoModel
from ..interface.models.rest_models import TaskQueuePOSTBody
from ..interface.models.task_models import Pr... | true | true |
f70887653f4a99c859d4974b9a671614af60f65c | 1,445 | py | Python | nipype/interfaces/fsl/tests/test_auto_ImageMeants.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_ImageMeants.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_ImageMeants.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.utils import ImageMeants
def test_ImageMeants_inputs():
input_map = dict(args=dict(argstr='%s',
),
eig=dict(argstr='--eig',
),
environ=dict(nohash=True,
usedefault=True,
... | 24.913793 | 78 | 0.626298 |
from nipype.testing import assert_equal
from nipype.interfaces.fsl.utils import ImageMeants
def test_ImageMeants_inputs():
input_map = dict(args=dict(argstr='%s',
),
eig=dict(argstr='--eig',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefa... | true | true |
f70888cccef2dea4dc7409027873cec829ecaa0e | 3,682 | py | Python | backend/shopping-cart-service/add_to_cart.py | qingshui-hui/aws-serverless-shopping-cart | 3838c981b02726e1ff7b504f1aa0f99b1ddf9b5a | [
"MIT-0"
] | null | null | null | backend/shopping-cart-service/add_to_cart.py | qingshui-hui/aws-serverless-shopping-cart | 3838c981b02726e1ff7b504f1aa0f99b1ddf9b5a | [
"MIT-0"
] | null | null | null | backend/shopping-cart-service/add_to_cart.py | qingshui-hui/aws-serverless-shopping-cart | 3838c981b02726e1ff7b504f1aa0f99b1ddf9b5a | [
"MIT-0"
] | null | null | null | import json
import os
import boto3
from aws_lambda_powertools import Logger, Metrics, Tracer
from shared import (
NotFoundException,
generate_ttl,
get_cart_id,
get_headers,
get_user_sub,
)
from utils import get_product_from_external_service
logger = Logger()
tracer = Tracer()
metrics = Metrics()
... | 32.017391 | 117 | 0.591798 | import json
import os
import boto3
from aws_lambda_powertools import Logger, Metrics, Tracer
from shared import (
NotFoundException,
generate_ttl,
get_cart_id,
get_headers,
get_user_sub,
)
from utils import get_product_from_external_service
logger = Logger()
tracer = Tracer()
metrics = Metrics()
... | true | true |
f70888fefa0932966b4e0cafeacfa5a514ce37b1 | 13,148 | py | Python | src/config/api-server/vnc_cfg_api_server/tests/resources/test_sync_node_profile.py | Dmitry-Eremeev/contrail-controller | 1238bcff697981662225ec5a15bc4d3d2237ae93 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/tests/resources/test_sync_node_profile.py | Dmitry-Eremeev/contrail-controller | 1238bcff697981662225ec5a15bc4d3d2237ae93 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/tests/resources/test_sync_node_profile.py | Dmitry-Eremeev/contrail-controller | 1238bcff697981662225ec5a15bc4d3d2237ae93 | [
"Apache-2.0"
] | null | null | null | import logging
import pprint
from vnc_api.gen.resource_client import Card
from vnc_api.gen.resource_client import Hardware
from vnc_api.gen.resource_client import Node
from vnc_api.gen.resource_client import NodeProfile
from vnc_api.gen.resource_client import Port
from vnc_api.gen.resource_client import Tag
from vnc_a... | 42.688312 | 78 | 0.5054 | import logging
import pprint
from vnc_api.gen.resource_client import Card
from vnc_api.gen.resource_client import Hardware
from vnc_api.gen.resource_client import Node
from vnc_api.gen.resource_client import NodeProfile
from vnc_api.gen.resource_client import Port
from vnc_api.gen.resource_client import Tag
from vnc_a... | true | true |
f70889aa8067984aad29790c5f57f13c36b50ae1 | 8,204 | py | Python | CDAN-GD/pre_process.py | MoriZSJ/GVB | 9b954660ef377ead81c8e631c4a0f4a17075b2ea | [
"MIT"
] | null | null | null | CDAN-GD/pre_process.py | MoriZSJ/GVB | 9b954660ef377ead81c8e631c4a0f4a17075b2ea | [
"MIT"
] | null | null | null | CDAN-GD/pre_process.py | MoriZSJ/GVB | 9b954660ef377ead81c8e631c4a0f4a17075b2ea | [
"MIT"
] | null | null | null | import numpy as np
from torchvision import transforms
import os
from PIL import Image, ImageOps
import numbers
import torch
class ResizeImage():
def __init__(self, size):
if isinstance(size, int):
self.size = (int(size), int(size))
else:
self.size = size
def __call__(s... | 31.43295 | 91 | 0.576548 | import numpy as np
from torchvision import transforms
import os
from PIL import Image, ImageOps
import numbers
import torch
class ResizeImage():
def __init__(self, size):
if isinstance(size, int):
self.size = (int(size), int(size))
else:
self.size = size
def __call__(s... | true | true |
f70889fb73d826435c3a78574b11a432ea63d154 | 17,638 | py | Python | View/cadastro_fornecedor.py | felipezago/ControleEstoque | 229659c4f9888fd01df34375ec92af7a1f734d10 | [
"MIT"
] | null | null | null | View/cadastro_fornecedor.py | felipezago/ControleEstoque | 229659c4f9888fd01df34375ec92af7a1f734d10 | [
"MIT"
] | null | null | null | View/cadastro_fornecedor.py | felipezago/ControleEstoque | 229659c4f9888fd01df34375ec92af7a1f734d10 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/cadastro_fornecedor.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 impo... | 43.875622 | 105 | 0.707677 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ct_FormFornecedor(object):
def setupUi(self, ct_FormFornecedor):
ct_FormFornecedor.setObjectName("ct_FormFornecedor")
ct_FormFornecedor.resize(653, 371)
self.fr_FormFornecedor = QtWidgets.QFrame(ct_FormFornecedor)
self.f... | true | true |
f7088ab28b5d544214f4b2534e46dd9c09bd6fea | 3,830 | py | Python | code/cmoa-img-desc-parallel/scraper.py | CreativeInquiry/TeenieHarrisProject | c7c2e1730ade29ed086a4bd21d5d21315fcde5e5 | [
"MIT"
] | null | null | null | code/cmoa-img-desc-parallel/scraper.py | CreativeInquiry/TeenieHarrisProject | c7c2e1730ade29ed086a4bd21d5d21315fcde5e5 | [
"MIT"
] | 9 | 2019-03-27T18:42:41.000Z | 2019-03-31T17:04:24.000Z | code/cmoa-img-desc-parallel/scraper.py | CreativeInquiry/TeenieHarrisProject | c7c2e1730ade29ed086a4bd21d5d21315fcde5e5 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
import os
import sys
from glob import glob
import re
import json
import random
import shutil
import re
import codecs
dones = [x for x in open("done.txt",'r').read().split("\n... | 33.893805 | 129 | 0.6047 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
import os
import sys
from glob import glob
import re
import json
import random
import shutil
import re
import codecs
dones = [x for x in open("done.txt",'r').read().split("\n... | true | true |
f7088b733943ec4deaa0fa6c680bb6105d440e68 | 2,151 | py | Python | src/automotive/core/can/tools/reader/usb_can_reader.py | philosophy912/automotive | de918611652b789a83545f346c1569c2c2c955a6 | [
"Apache-2.0"
] | null | null | null | src/automotive/core/can/tools/reader/usb_can_reader.py | philosophy912/automotive | de918611652b789a83545f346c1569c2c2c955a6 | [
"Apache-2.0"
] | null | null | null | src/automotive/core/can/tools/reader/usb_can_reader.py | philosophy912/automotive | de918611652b789a83545f346c1569c2c2c955a6 | [
"Apache-2.0"
] | 1 | 2022-02-28T07:23:28.000Z | 2022-02-28T07:23:28.000Z | # -*- coding:utf-8 -*-
# --------------------------------------------------------
# Copyright (C), 2016-2020, lizhe, All rights reserved
# --------------------------------------------------------
# @Name: usb_can_reader.py
# @Author: lizhe
# @Created: 2021/5/1 - 23:45
# ---------------------------------... | 35.85 | 105 | 0.535565 |
import re
from typing import List, Tuple
from automotive.core.can.message import Message
from .trace_reader import TraceReader
from automotive.logger.logger import logger
class UsbCanReader(TraceReader):
def read(self, file: str) -> List[Tuple[float, Message]]:
contents = self.__filter_content(f... | true | true |
f7088bd373aef47e9887dc1b0e5be23ea3cb543e | 190 | py | Python | premium/backend/src/baserow_premium/api/urls.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | null | null | null | premium/backend/src/baserow_premium/api/urls.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | null | null | null | premium/backend/src/baserow_premium/api/urls.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | null | null | null | from django.urls import path, include
from .admin import urls as admin_urls
app_name = "baserow_premium.api"
urlpatterns = [
path("admin/", include(admin_urls, namespace="admin")),
]
| 19 | 59 | 0.731579 | from django.urls import path, include
from .admin import urls as admin_urls
app_name = "baserow_premium.api"
urlpatterns = [
path("admin/", include(admin_urls, namespace="admin")),
]
| true | true |
f7088bdebaf4c3ef67a5162ba9bd81693a179b45 | 1,619 | py | Python | octoprint_codemods/yield_from_generator.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | 5 | 2020-10-06T12:02:23.000Z | 2021-04-26T00:31:55.000Z | octoprint_codemods/yield_from_generator.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | null | null | null | octoprint_codemods/yield_from_generator.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | 1 | 2020-10-10T17:18:39.000Z | 2020-10-10T17:18:39.000Z | from typing import Union, cast
import libcst as cst
import libcst.matchers as m
from .util import CodeMod, runner
"""
libcst based transformer to convert 'for x in generator: yield x' to 'yield from generator'.
"""
__author__ = "Gina Häußge <gina@octoprint.org>"
__license__ = "MIT"
class YieldFromGenerator(CodeMo... | 29.436364 | 92 | 0.579988 | from typing import Union, cast
import libcst as cst
import libcst.matchers as m
from .util import CodeMod, runner
__author__ = "Gina Häußge <gina@octoprint.org>"
__license__ = "MIT"
class YieldFromGenerator(CodeMod):
DESCRIPTION: str = "Converts 'for x in generator: yield x' to 'yield from generator'."
d... | true | true |
f7088c087cad60100e39ebb04ca112f5066abe65 | 11,764 | py | Python | google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/base.py | Nawod/python-aiplatform | ffc70d148868489161797cc25a63298dda322d5f | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/base.py | Nawod/python-aiplatform | ffc70d148868489161797cc25a63298dda322d5f | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/base.py | Nawod/python-aiplatform | ffc70d148868489161797cc25a63298dda322d5f | [
"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... | 37.11041 | 103 | 0.663125 |
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources
import google.auth
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import re... | true | true |
f7088c22019381ab4d1c04624a2767d334cb277b | 1,111 | py | Python | PythonBaseDemo/ModulesAndPackages/9.1/import_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/ModulesAndPackages/9.1/import_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/ModulesAndPackages/9.1/import_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... | 58.473684 | 73 | 0.193519 | true | true | |
f7088c63313f91b709e1ed0c583841d1f3be3c28 | 92,660 | py | Python | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | Halimaz/tensorflow-1 | 3437fba39d5bca77fd7627aad15ba76fb75f5731 | [
"Apache-2.0"
] | 1 | 2018-08-15T10:03:38.000Z | 2018-08-15T10:03:38.000Z | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | Halimaz/tensorflow-1 | 3437fba39d5bca77fd7627aad15ba76fb75f5731 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | Halimaz/tensorflow-1 | 3437fba39d5bca77fd7627aad15ba76fb75f5731 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.897751 | 85 | 0.657555 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import numpy as np
from six.moves import xrange
from tensorflow.contrib import rnn as rnn_lib
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.eager imp... | true | true |
f7088d12531d2cc76918d77327731449d698a09b | 2,304 | py | Python | tests/test_run.py | hfchong/dvc | 2e3ce3b3dbb02f6524b0383e3f599c4561413634 | [
"Apache-2.0"
] | null | null | null | tests/test_run.py | hfchong/dvc | 2e3ce3b3dbb02f6524b0383e3f599c4561413634 | [
"Apache-2.0"
] | null | null | null | tests/test_run.py | hfchong/dvc | 2e3ce3b3dbb02f6524b0383e3f599c4561413634 | [
"Apache-2.0"
] | null | null | null | import os
import filecmp
from dvc.main import main
from dvc.utils import file_md5
from dvc.stage import Stage
from dvc.command.run import CmdRun
from tests.basic_env import TestDvc
class TestRun(TestDvc):
def test(self):
cmd = 'python {} {} {}'.format(self.CODE, self.FOO, 'out')
deps = [self.FOO... | 31.561644 | 78 | 0.523438 | import os
import filecmp
from dvc.main import main
from dvc.utils import file_md5
from dvc.stage import Stage
from dvc.command.run import CmdRun
from tests.basic_env import TestDvc
class TestRun(TestDvc):
def test(self):
cmd = 'python {} {} {}'.format(self.CODE, self.FOO, 'out')
deps = [self.FOO... | true | true |
f7088d26d6e642b7dffd25f3df9157dad7084972 | 8,462 | py | Python | airflow/providers/cncf/kubernetes/hooks/kubernetes.py | omad/airflow | 663259d4b541ab10ce55fec4d2460e23917062c2 | [
"Apache-2.0"
] | 1 | 2021-07-07T15:13:51.000Z | 2021-07-07T15:13:51.000Z | airflow/providers/cncf/kubernetes/hooks/kubernetes.py | omad/airflow | 663259d4b541ab10ce55fec4d2460e23917062c2 | [
"Apache-2.0"
] | 1 | 2020-10-15T22:39:05.000Z | 2020-10-15T22:39:05.000Z | airflow/providers/cncf/kubernetes/hooks/kubernetes.py | tanjinP/airflow | f0b9aae564805fb09328faf0c47f441ee0699ed8 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.608889 | 110 | 0.650201 |
import tempfile
from typing import Any, Generator, Optional, Tuple, Union
import yaml
from cached_property import cached_property
from kubernetes import client, config, watch
from airflow.exceptions import AirflowException
from airflow.hooks.base_hook import BaseHook
def _load_body_to_dict(body):
... | true | true |
f7088d8ddc8d7584686f5d81c7a2b9b5233b813c | 128 | py | Python | src/init.py | HofmannCh/PythonSnake | e737414f1e9150bdd22d6267a53e25b85f3b5ccc | [
"MIT"
] | null | null | null | src/init.py | HofmannCh/PythonSnake | e737414f1e9150bdd22d6267a53e25b85f3b5ccc | [
"MIT"
] | null | null | null | src/init.py | HofmannCh/PythonSnake | e737414f1e9150bdd22d6267a53e25b85f3b5ccc | [
"MIT"
] | null | null | null | from Window import Window
from Logic import Logic
print("Init")
logic = Logic()
win = Window(logic)
win.mainloop()
print("End") | 16 | 25 | 0.734375 | from Window import Window
from Logic import Logic
print("Init")
logic = Logic()
win = Window(logic)
win.mainloop()
print("End") | true | true |
f7088ed2ed08b3c8c7ac9ec0bca022ea7e57a025 | 735 | py | Python | students/K33422/Iskhakova_Emina/labs/lab1/task2_server.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | students/K33422/Iskhakova_Emina/labs/lab1/task2_server.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | students/K33422/Iskhakova_Emina/labs/lab1/task2_server.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('localhost', 8080))
sock.listen(1)
clientsoc, addr = sock.accept()
print('connected:', addr)
message = ''
while True:
clientsoc.sendall(bytes(message + f'Enter two bases and its hight or "exit" to finish the program', "u... | 27.222222 | 114 | 0.560544 | import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('localhost', 8080))
sock.listen(1)
clientsoc, addr = sock.accept()
print('connected:', addr)
message = ''
while True:
clientsoc.sendall(bytes(message + f'Enter two bases and its hight or "exit" to finish the program', "u... | true | true |
f708911d8933c643cca11ef42a3909ff1dc435e3 | 595 | py | Python | angr/procedures/libc/fscanf.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 2 | 2020-04-29T02:39:42.000Z | 2020-04-29T08:07:44.000Z | angr/procedures/libc/fscanf.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | null | null | null | angr/procedures/libc/fscanf.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 3 | 2019-10-17T07:47:36.000Z | 2022-01-24T23:38:13.000Z | from angr.procedures.stubs.format_parser import FormatParser
from cle.backends.externs.simdata.io_file import io_file_data_for_arch
class fscanf(FormatParser):
#pylint:disable=arguments-differ
def run(self, file_ptr):
# TODO handle errors
fd_offset = io_file_data_for_arch(self.state.arch)['f... | 29.75 | 70 | 0.678992 | from angr.procedures.stubs.format_parser import FormatParser
from cle.backends.externs.simdata.io_file import io_file_data_for_arch
class fscanf(FormatParser):
def run(self, file_ptr):
fd_offset = io_file_data_for_arch(self.state.arch)['fd']
fd = self.state.mem[file_ptr + fd_offset... | true | true |
f708920170b2d6285358225fb37557f4b233ef57 | 5,448 | py | Python | gomatic/gocd/artifacts.py | ayr-ton/gomatic | 314d0bed56888f44326f15ca6b2da20e7909cf67 | [
"MIT"
] | 96 | 2015-01-06T22:08:29.000Z | 2017-06-01T08:14:11.000Z | gomatic/gocd/artifacts.py | ayr-ton/gomatic | 314d0bed56888f44326f15ca6b2da20e7909cf67 | [
"MIT"
] | 50 | 2017-06-10T20:10:12.000Z | 2021-12-21T15:41:25.000Z | gomatic/gocd/artifacts.py | ayr-ton/gomatic | 314d0bed56888f44326f15ca6b2da20e7909cf67 | [
"MIT"
] | 39 | 2017-06-10T20:06:16.000Z | 2021-10-30T14:18:09.000Z | from xml.etree import ElementTree as ET
from gomatic.mixins import CommonEqualityMixin
def fetch_artifact_src_from(element):
if 'srcfile' in element.attrib:
return FetchArtifactFile(element.attrib['srcfile'])
if 'srcdir' in element.attrib:
return FetchArtifactDir(element.attrib['srcdir'])
... | 41.587786 | 202 | 0.643172 | from xml.etree import ElementTree as ET
from gomatic.mixins import CommonEqualityMixin
def fetch_artifact_src_from(element):
if 'srcfile' in element.attrib:
return FetchArtifactFile(element.attrib['srcfile'])
if 'srcdir' in element.attrib:
return FetchArtifactDir(element.attrib['srcdir'])
... | true | true |
f7089239c29071e4fcbee245e9912b787606573e | 6,882 | py | Python | multiphonon/ui/getdos0.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 1 | 2019-05-22T08:46:09.000Z | 2019-05-22T08:46:09.000Z | multiphonon/ui/getdos0.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 118 | 2016-04-04T12:27:15.000Z | 2021-08-18T01:46:13.000Z | multiphonon/ui/getdos0.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 5 | 2017-09-28T16:01:12.000Z | 2020-01-31T18:58:09.000Z |
def notebookUI(samplenxs, mtnxs, initdos=None, options=None, load_options_path=None):
import yaml
if options is not None and load_options_path:
raise RuntimeError(
"Both options and load_options_path were set: %s, %s" %(
options, load_options_path)
)
if load_opti... | 39.102273 | 144 | 0.622784 |
def notebookUI(samplenxs, mtnxs, initdos=None, options=None, load_options_path=None):
import yaml
if options is not None and load_options_path:
raise RuntimeError(
"Both options and load_options_path were set: %s, %s" %(
options, load_options_path)
)
if load_opti... | true | true |
f708928e9cd5afabafcf6b37d400298162bd755f | 15,941 | py | Python | mars/dataframe/base/drop.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/dataframe/base/drop.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/dataframe/base/drop.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 Alibaba Group Holding 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 a... | 32.93595 | 111 | 0.56753 |
import warnings
from collections import OrderedDict
import numpy as np
from ... import opcodes
from ...core import Entity, Chunk, CHUNK_TYPE, OutputType, recursive_tile
from ...serialization.serializables import AnyField, StringField
from ..core import IndexValue, DATAFRAME_TYPE, SERIES_TYPE, INDEX_CHUN... | true | true |
f70892be43edd841758689d19686bf38cf8dd5a0 | 626 | py | Python | app/data.py | tjdaley/publicdataws | 1aa4a98cf47fae10cc0f59a8d01168df806b4919 | [
"MIT"
] | null | null | null | app/data.py | tjdaley/publicdataws | 1aa4a98cf47fae10cc0f59a8d01168df806b4919 | [
"MIT"
] | null | null | null | app/data.py | tjdaley/publicdataws | 1aa4a98cf47fae10cc0f59a8d01168df806b4919 | [
"MIT"
] | null | null | null | def Articles():
return [
{
'id': 1,
'title': 'Article 1',
'body': 'Body of first article',
'author': 'Tom Daley',
'create_date': '07-28-2019'
},
{
'id': 2,
'title': 'Article 2',
'body': 'Body of s... | 26.083333 | 45 | 0.375399 | def Articles():
return [
{
'id': 1,
'title': 'Article 1',
'body': 'Body of first article',
'author': 'Tom Daley',
'create_date': '07-28-2019'
},
{
'id': 2,
'title': 'Article 2',
'body': 'Body of s... | true | true |
f70895bc8cf25fe899a820773083413febdc7000 | 1,033 | py | Python | SidToS3/aws/s3.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | SidToS3/aws/s3.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | SidToS3/aws/s3.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | import boto3
import botocore
class S3:
def __init__(self, key, secret, bucket):
self.Key = key
self.Secret = secret
self.Bucket = bucket
return
def upload_file(self, local_file, remote_file):
s3 = boto3.resource(
's3',
aws_access_key_id=self.Ke... | 25.195122 | 73 | 0.560503 | import boto3
import botocore
class S3:
def __init__(self, key, secret, bucket):
self.Key = key
self.Secret = secret
self.Bucket = bucket
return
def upload_file(self, local_file, remote_file):
s3 = boto3.resource(
's3',
aws_access_key_id=self.Ke... | true | true |
f70895bfda8c4b1ae18bdbfc9932d3a9e1ad00b9 | 11,278 | py | Python | var/spack/repos/builtin/packages/octave/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/octave/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/octave/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2020 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)
import os.path
import shutil
import sys
import tempfile
import spack.util.environment
class Octave(AutotoolsPackage, GNU... | 39.57193 | 95 | 0.582373 |
import os.path
import shutil
import sys
import tempfile
import spack.util.environment
class Octave(AutotoolsPackage, GNUMirrorPackage):
homepage = "https://www.gnu.org/software/octave/"
gnu_mirror_path = "octave/octave-4.0.0.tar.gz"
maintainers = ['mtmiller']
extendable = True
version('5.1... | true | true |
f708960fdb8e9cb12cb0f17da5644933690a1490 | 395 | py | Python | travellog/wsgi.py | jacobian/django-travellog | 1712cbeebb8ccceb620757ada3927c545793b7b8 | [
"BSD-3-Clause"
] | 9 | 2018-04-17T18:39:47.000Z | 2021-08-18T06:27:57.000Z | travellog/wsgi.py | jacobian/django-travellog | 1712cbeebb8ccceb620757ada3927c545793b7b8 | [
"BSD-3-Clause"
] | null | null | null | travellog/wsgi.py | jacobian/django-travellog | 1712cbeebb8ccceb620757ada3927c545793b7b8 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for travellog 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.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "travellog.settings")
application = get_wsgi_application()
| true | true |
f70896259323c12a6a8a8989b79dfbdb5e1f2dfa | 1,080 | py | Python | libp2p/network/stream/net_stream.py | ChihChengLiang/py-libp2p | f0046fa3e0952b492837a698b1988e05c9821f47 | [
"Apache-2.0",
"MIT"
] | null | null | null | libp2p/network/stream/net_stream.py | ChihChengLiang/py-libp2p | f0046fa3e0952b492837a698b1988e05c9821f47 | [
"Apache-2.0",
"MIT"
] | null | null | null | libp2p/network/stream/net_stream.py | ChihChengLiang/py-libp2p | f0046fa3e0952b492837a698b1988e05c9821f47 | [
"Apache-2.0",
"MIT"
] | null | null | null | from .net_stream_interface import INetStream
class NetStream(INetStream):
def __init__(self, muxed_stream):
self.muxed_stream = muxed_stream
self.mplex_conn = muxed_stream.mplex_conn
self.protocol_id = None
def get_protocol(self):
"""
:return: protocol id that stream ... | 24 | 59 | 0.587963 | from .net_stream_interface import INetStream
class NetStream(INetStream):
def __init__(self, muxed_stream):
self.muxed_stream = muxed_stream
self.mplex_conn = muxed_stream.mplex_conn
self.protocol_id = None
def get_protocol(self):
return self.protocol_id
def set_protocol... | true | true |
f70897147c867957abfe46861db62aa36828a286 | 5,274 | py | Python | pandas/tests/indexing/common.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-07T04:58:36.000Z | 2021-05-07T04:58:59.000Z | pandas/tests/indexing/common.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexing/common.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-06-16T07:19:12.000Z | 2021-12-16T10:24:44.000Z | """ common utilities """
import itertools
import numpy as np
from pandas import (
DataFrame,
Float64Index,
MultiIndex,
Series,
UInt64Index,
date_range,
)
import pandas._testing as tm
def _mklbl(prefix, n):
return [f"{prefix}{i}" for i in range(n)]
def _axify(obj, key, axis):
# crea... | 27.904762 | 88 | 0.520288 | import itertools
import numpy as np
from pandas import (
DataFrame,
Float64Index,
MultiIndex,
Series,
UInt64Index,
date_range,
)
import pandas._testing as tm
def _mklbl(prefix, n):
return [f"{prefix}{i}" for i in range(n)]
def _axify(obj, key, axis):
axes = [slice(None)] * obj... | true | true |
f708974711d14541ae6b980973337a70daf55ace | 420 | py | Python | website/example_problem_graders/simpleai.py | pshen24/cmimc-online | 7d2435e506381fa19f3512635eb615f7a02e5f03 | [
"MIT"
] | null | null | null | website/example_problem_graders/simpleai.py | pshen24/cmimc-online | 7d2435e506381fa19f3512635eb615f7a02e5f03 | [
"MIT"
] | null | null | null | website/example_problem_graders/simpleai.py | pshen24/cmimc-online | 7d2435e506381fa19f3512635eb615f7a02e5f03 | [
"MIT"
] | null | null | null | from .base import BaseGrader
class SimpleAI(BaseGrader):
def grade(self, submission, score):
try:
points = int(submission.text)
except ValueError:
points = 0
submission.points = points
submission.is_graded = True
submission.save()
... | 24.705882 | 51 | 0.585714 | from .base import BaseGrader
class SimpleAI(BaseGrader):
def grade(self, submission, score):
try:
points = int(submission.text)
except ValueError:
points = 0
submission.points = points
submission.is_graded = True
submission.save()
... | true | true |
f70897b4f50c3d304da65ac9f86af36b1c7be865 | 2,183 | py | Python | Examples/SHMExample.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | Examples/SHMExample.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | Examples/SHMExample.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------- #
# This example was designed to show the project-level optimization
# option in GIAMS. This example was used in the original paper as well
# -------------------------------------------------------------------- #
import time
import ast
from Netwo... | 23.223404 | 86 | 0.674301 |
import time
import ast
from Network import IndianaNetwork
from LifeCycleAnalyzer.Simulators import MainSimulator
from LifeCycleAnalyzer import LCA
from Optimizer import HillClimbing
from Optimizer import BruteForce
from Optimizer import GA
from Optimizer import IUC
from Optimizer import PSO
from utils.Predictive... | true | true |
f70897f9eb8aeca2cd474fecd27ec7d2df2c1157 | 5,421 | py | Python | addons/stock_dropshipping/tests/test_dropship.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/stock_dropshipping/tests/test_dropship.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/stock_dropshipping/tests/test_dropship.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common, Form
from odoo.tools import mute_logger
class TestDropship(common.TransactionCase):
def test_change_qty(self):
# enable the dropship and MTO route on the product
prod ... | 43.717742 | 112 | 0.611695 |
from odoo.tests import common, Form
from odoo.tools import mute_logger
class TestDropship(common.TransactionCase):
def test_change_qty(self):
prod = self.env.ref('product.product_product_8')
dropshipping_route = self.env.ref('stock_dropshipping.route_drop_shipping')
mto_route =... | true | true |
f7089a3189e9200c44cfa339fb72e02b96aba0ef | 241 | py | Python | imagr_site/urls.py | cewing/cfpydev-imagr | 423ec9d9b38be990ab7dca027877e1c12f3d07fe | [
"MIT"
] | null | null | null | imagr_site/urls.py | cewing/cfpydev-imagr | 423ec9d9b38be990ab7dca027877e1c12f3d07fe | [
"MIT"
] | null | null | null | imagr_site/urls.py | cewing/cfpydev-imagr | 423ec9d9b38be990ab7dca027877e1c12f3d07fe | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('imagr_users.urls'))
)
| 21.909091 | 51 | 0.701245 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('imagr_users.urls'))
)
| true | true |
f7089a89f944e9cd852c6eb3d6019ff7857667e6 | 12,486 | py | Python | .history/implementations/pixelda/pixelda_20190101201505.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | .history/implementations/pixelda/pixelda_20190101201505.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | .history/implementations/pixelda/pixelda_20190101201505.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... | 37.271642 | 129 | 0.610764 | import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... | true | true |
f7089ba093dc0bbb1c054cb1d3da1322b5b180f0 | 346 | py | Python | plotting-beginner-plotting-cookbook/pltcp.py | hrayatnia/SciPy | a50dcbb6b8adffbc526eec93f5009f09943786e3 | [
"BSD-3-Clause"
] | null | null | null | plotting-beginner-plotting-cookbook/pltcp.py | hrayatnia/SciPy | a50dcbb6b8adffbc526eec93f5009f09943786e3 | [
"BSD-3-Clause"
] | null | null | null | plotting-beginner-plotting-cookbook/pltcp.py | hrayatnia/SciPy | a50dcbb6b8adffbc526eec93f5009f09943786e3 | [
"BSD-3-Clause"
] | 1 | 2021-08-14T23:05:03.000Z | 2021-08-14T23:05:03.000Z | import numpy as np
import matplotlib.patches as patches
import matplotlib.pyplot as plt
ax = plt.axes(polar = True)
theta = np.linspace(0, 2 * np.pi, 8, endpoint = False)
radius = .25 + .75 * np.random.random(size = len(theta))
points = np.vstack((theta, radius)).transpose()
plt.gca().add_patch(patches.Polygon(points, ... | 38.444444 | 59 | 0.710983 | import numpy as np
import matplotlib.patches as patches
import matplotlib.pyplot as plt
ax = plt.axes(polar = True)
theta = np.linspace(0, 2 * np.pi, 8, endpoint = False)
radius = .25 + .75 * np.random.random(size = len(theta))
points = np.vstack((theta, radius)).transpose()
plt.gca().add_patch(patches.Polygon(points, ... | true | true |
f7089c9da38300abd4358f58c0aaa203dffd7c0e | 710 | py | Python | weatherterm/core/parser_loader.py | eustone/weather-app | 06b85178cf9e8a195c69d3622af73cc2d15ed7a8 | [
"MIT"
] | null | null | null | weatherterm/core/parser_loader.py | eustone/weather-app | 06b85178cf9e8a195c69d3622af73cc2d15ed7a8 | [
"MIT"
] | null | null | null | weatherterm/core/parser_loader.py | eustone/weather-app | 06b85178cf9e8a195c69d3622af73cc2d15ed7a8 | [
"MIT"
] | null | null | null | import os
import re
import inspect
def _get_parser_list(dirname):
files = [ f.replace('.py','') for f in os.listdir(dirname) if not f.startswith('__')
]
return files
def _import_parsers(parserfiles):
m = re.compile('.+parsers',re.I)
_modules = __import__('weatherterm.parsers',globals(),locals(),pa... | 32.272727 | 100 | 0.690141 | import os
import re
import inspect
def _get_parser_list(dirname):
files = [ f.replace('.py','') for f in os.listdir(dirname) if not f.startswith('__')
]
return files
def _import_parsers(parserfiles):
m = re.compile('.+parsers',re.I)
_modules = __import__('weatherterm.parsers',globals(),locals(),pa... | true | true |
f7089df20096a6a03930477e8e401ffe4dc43232 | 1,115 | py | Python | setup.py | ajgomez529/google-maps-services-python | 9c38623cdd2400caade224d9968abd1bce610daa | [
"Apache-2.0"
] | null | null | null | setup.py | ajgomez529/google-maps-services-python | 9c38623cdd2400caade224d9968abd1bce610daa | [
"Apache-2.0"
] | null | null | null | setup.py | ajgomez529/google-maps-services-python | 9c38623cdd2400caade224d9968abd1bce610daa | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
requirements = ["requests>=2.20.0,<3.0"]
with open("README.md") as f:
readme = f.read()
with open("CHANGELOG.md") as f:
changelog = f.read()
setup(
name="googlemaps",
version="4.4.4",
description="Python client library for Google Maps Platform",
long_descriptio... | 28.589744 | 68 | 0.632287 | from setuptools import setup
requirements = ["requests>=2.20.0,<3.0"]
with open("README.md") as f:
readme = f.read()
with open("CHANGELOG.md") as f:
changelog = f.read()
setup(
name="googlemaps",
version="4.4.4",
description="Python client library for Google Maps Platform",
long_descriptio... | true | true |
f7089dfe6fe74007cb8636beea498cb478d8602a | 21,442 | py | Python | auto_enc.py | jobcpf/auto_encrypted | 39efd7b76e5efa9035654fd5cf9877a24a7caa08 | [
"BSD-3-Clause"
] | null | null | null | auto_enc.py | jobcpf/auto_encrypted | 39efd7b76e5efa9035654fd5cf9877a24a7caa08 | [
"BSD-3-Clause"
] | null | null | null | auto_enc.py | jobcpf/auto_encrypted | 39efd7b76e5efa9035654fd5cf9877a24a7caa08 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
"""
Auto Mount Encrypted Drives on external Credentials
@Author: oliver.blakeman@carbonprojectfinance.co.uk
@Date: 2018-07-25
Shebangs: (amend #!/ path at top based on env and app)
ferret: #!/usr/bin/python
"""
# Standard import
import sys
import os
import pwd
import time
# other
from subpro... | 39.634011 | 158 | 0.523878 |
import sys
import os
import pwd
import time
from subprocess import call, STDOUT, PIPE, Popen
FNULL = open(os.devnull, 'w')
import Tkinter as tk
import logging
logfile = "/tmp/auto_enc_test.log"
logging.basicConfig(filename=logfile,level=logging.DEBUG)
| true | true |
f7089e12767a1d19a0a295981ad26d0728e640fe | 139 | py | Python | 1170.py | gabzin/uri | 177bdf3f87bacfd924bd031a973b8db877379fe5 | [
"MIT"
] | 3 | 2021-09-21T18:50:20.000Z | 2021-12-14T13:07:31.000Z | 1170.py | gabzin/uri | 177bdf3f87bacfd924bd031a973b8db877379fe5 | [
"MIT"
] | null | null | null | 1170.py | gabzin/uri | 177bdf3f87bacfd924bd031a973b8db877379fe5 | [
"MIT"
] | null | null | null | for n in range(int(input())):
c=float(input())
aux=0
while c>1:
c/=2
aux+=1
print(f"{aux} dias")
aux=0
| 15.444444 | 29 | 0.460432 | for n in range(int(input())):
c=float(input())
aux=0
while c>1:
c/=2
aux+=1
print(f"{aux} dias")
aux=0
| true | true |
f7089e39411df691557a32c6561b3e8f84d6cb00 | 17,037 | py | Python | lib/python3.8/site-packages/ansible/plugins/callback/__init__.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | 4 | 2021-09-16T01:32:29.000Z | 2022-03-24T07:32:10.000Z | lib/python3.8/site-packages/ansible/plugins/callback/__init__.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible/plugins/callback/__init__.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 38.545249 | 160 | 0.624523 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import difflib
import json
import os
import sys
import warnings
from copy import deepcopy
from ansible import constants as C
from ansible.module_utils.common._collections_compat import MutableMapping
from ansibl... | true | true |
f7089ef67286d4bd93b7bbb603e0c655b36ca314 | 3,090 | py | Python | docs/source/conf.py | swiftycloud/swifty | 5167df9c1ce213fa14887d3bda28beb02f688e33 | [
"MIT"
] | 33 | 2019-04-16T06:28:16.000Z | 2021-07-30T11:11:05.000Z | docs/source/conf.py | swiftycloud/swifty | 5167df9c1ce213fa14887d3bda28beb02f688e33 | [
"MIT"
] | null | null | null | docs/source/conf.py | swiftycloud/swifty | 5167df9c1ce213fa14887d3bda28beb02f688e33 | [
"MIT"
] | 2 | 2019-04-23T15:09:40.000Z | 2020-11-22T00:19:24.000Z | # -*- coding: utf-8 -*-
#
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path... | 31.212121 | 79 | 0.721036 |
from recommonmark.parser import CommonMarkParser
source_parsers = {
'.md': CommonMarkParser,
}
templates_path = ['_templates']
source_suffix = ['.rst', '.md']
master_doc = 'index'
project = u'Swifty'
copyright = u'2017 The Swifty Authors'
author = u'The Swifty Authors'
# |version|... | true | true |
f7089f47db2e2b77a6377a7ce32ab1734102e04b | 12,276 | py | Python | src/fuzzysearch/substitutions_only.py | klauer/fuzzysearch | 55fc21e469495bc84fe6f81b0c148e105765182d | [
"MIT"
] | null | null | null | src/fuzzysearch/substitutions_only.py | klauer/fuzzysearch | 55fc21e469495bc84fe6f81b0c148e105765182d | [
"MIT"
] | null | null | null | src/fuzzysearch/substitutions_only.py | klauer/fuzzysearch | 55fc21e469495bc84fe6f81b0c148e105765182d | [
"MIT"
] | null | null | null | from collections import deque, defaultdict
from itertools import islice
from functools import wraps
from fuzzysearch.common import FuzzySearchBase, Match, \
count_differences_with_maximum, get_best_match_in_group, group_matches
from fuzzysearch.compat import text_type
from fuzzysearch.search_exact import search_ex... | 39.220447 | 95 | 0.646546 | from collections import deque, defaultdict
from itertools import islice
from functools import wraps
from fuzzysearch.common import FuzzySearchBase, Match, \
count_differences_with_maximum, get_best_match_in_group, group_matches
from fuzzysearch.compat import text_type
from fuzzysearch.search_exact import search_ex... | true | true |
f7089fc1652a59fe4bfd3a036437c82422a909ff | 4,551 | py | Python | opensanctions/crawlers/us_trade_csl.py | opensanctions/opensanctions | 7dff9597f982d8918699b2cde3c7c337a941622d | [
"MIT"
] | 23 | 2022-02-09T12:50:36.000Z | 2022-03-30T16:04:19.000Z | opensanctions/crawlers/us_trade_csl.py | opensanctions/opennames | 39675797b0e70e71f54edff2b8e623e23aef9c15 | [
"MIT"
] | 10 | 2022-02-03T08:44:03.000Z | 2022-03-21T15:27:40.000Z | opensanctions/crawlers/us_trade_csl.py | opensanctions/opennames | 39675797b0e70e71f54edff2b8e623e23aef9c15 | [
"MIT"
] | 2 | 2022-02-16T11:51:05.000Z | 2022-03-02T16:55:08.000Z | import json
from banal import ensure_list
from functools import cache
from pantomime.types import JSON
from requests.exceptions import RequestException
from opensanctions.core import Dataset, Context
from opensanctions import helpers as h
FORMATS = ["%d %b %Y", "%d %B %Y", "%Y", "%b %Y", "%B %Y"]
@cache
def deref_u... | 37 | 81 | 0.63964 | import json
from banal import ensure_list
from functools import cache
from pantomime.types import JSON
from requests.exceptions import RequestException
from opensanctions.core import Dataset, Context
from opensanctions import helpers as h
FORMATS = ["%d %b %Y", "%d %B %Y", "%Y", "%b %Y", "%B %Y"]
@cache
def deref_u... | true | true |
f7089fd57cec358e4874c6bc3d56e045107f7023 | 6,383 | py | Python | lottery_ticket/foundations/trainer.py | mitchellgordon95/lottery-ticket-hypothesis | 3b2abee4b1e9ba00fe8501ac86652e2604736405 | [
"Apache-2.0"
] | 1 | 2019-06-05T03:13:48.000Z | 2019-06-05T03:13:48.000Z | lottery_ticket/foundations/trainer.py | mitchellgordon95/lottery-ticket-hypothesis | 3b2abee4b1e9ba00fe8501ac86652e2604736405 | [
"Apache-2.0"
] | null | null | null | lottery_ticket/foundations/trainer.py | mitchellgordon95/lottery-ticket-hypothesis | 3b2abee4b1e9ba00fe8501ac86652e2604736405 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.920732 | 80 | 0.704841 |
from lottery_ticket.foundations import paths
from lottery_ticket.foundations import save_restore
import tensorflow as tf
def train(sess, dataset, model, optimizer_fn, training_len, output_dir,
**params):
optimize = optimizer_fn().minimize(model.loss)
sess.run(tf.global_variables_initia... | true | true |
f708a0ea971eb7efea305a6a5c363b305b1237e7 | 30,838 | py | Python | tensorflow_probability/python/experimental/mcmc/windowed_sampling_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 3,670 | 2018-02-14T03:29:40.000Z | 2022-03-30T01:19:52.000Z | tensorflow_probability/python/experimental/mcmc/windowed_sampling_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,395 | 2018-02-24T02:28:49.000Z | 2022-03-31T16:12:06.000Z | tensorflow_probability/python/experimental/mcmc/windowed_sampling_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,135 | 2018-02-14T01:51:10.000Z | 2022-03-28T02:24:11.000Z | # Copyright 2021 The TensorFlow Probability 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 ... | 35.983664 | 94 | 0.646994 |
from absl.testing import parameterized
import numpy as np
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.experimental import distribute
from tensorflow_probability.python.experimental.mcmc import windowed_sampling
from tensorflow_probability.pyth... | true | true |
f708a2f9c97d4edc9089d4d6c7b978043dd53de3 | 4,813 | py | Python | s3prl/downstream/voxceleb1/expert.py | andybi7676/s3prl | 0e5acc5d499a629f946d561d87e8924ba3eb004b | [
"MIT"
] | 3 | 2021-08-07T19:12:56.000Z | 2022-03-29T15:16:31.000Z | s3prl/downstream/voxceleb1/expert.py | andybi7676/s3prl | 0e5acc5d499a629f946d561d87e8924ba3eb004b | [
"MIT"
] | 2 | 2021-07-28T20:35:59.000Z | 2021-07-30T16:01:53.000Z | s3prl/downstream/voxceleb1/expert.py | andybi7676/s3prl | 0e5acc5d499a629f946d561d87e8924ba3eb004b | [
"MIT"
] | 2 | 2021-07-21T11:05:26.000Z | 2021-07-22T09:46:38.000Z | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ expert.py ]
# Synopsis [ the phone linear downstream wrapper ]
# Author [ S3PRL ]
# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]
"""******************... | 37.897638 | 125 | 0.606898 |
torch.nn.utils.rnn import pad_sequence
from ..model import *
from .dataset import SpeakerClassifiDataset
from argparse import Namespace
from pathlib import Path
class DownstreamExpert(nn.Module):
def __init__(self, upstream_dim, downstream_expert, expdir, **kwargs):
super(DownstreamExpert, self)._... | true | true |
f708a3ecd84ccc0740adfb8ca7ccc4b6f5725a25 | 1,031 | gyp | Python | Dependencies/gyp-master/test/win/shard/shard_ref.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/shard/shard_ref.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/shard/shard_ref.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | # Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'refs_to_shard_external_lib',
'type': 'static_library',
'dependencies': [
# Make sure referenc... | 24.547619 | 73 | 0.531523 |
{
'targets': [
{
'target_name': 'refs_to_shard_external_lib',
'type': 'static_library',
'dependencies': [
'shard.gyp:shard',
],
'sources': [
'hello.cc',
],
},
{
'target_name': 'refs_to_shard_external_exe',
'type': '... | true | true |
f708a40a4eec1b5655f85df4fa2c76a70a93f433 | 2,231 | py | Python | singa_easy/modules/mod_modelslicing/utils/lr_scheduler.py | arielclj/singa-easy | fd4bc601a5501062936f874df14711a3cefa1346 | [
"Apache-2.0"
] | 6 | 2020-04-28T16:57:15.000Z | 2021-08-07T13:06:28.000Z | singa_easy/modules/mod_modelslicing/utils/lr_scheduler.py | arielclj/singa-easy | fd4bc601a5501062936f874df14711a3cefa1346 | [
"Apache-2.0"
] | 41 | 2020-04-06T13:18:40.000Z | 2021-01-20T04:29:50.000Z | singa_easy/modules/mod_modelslicing/utils/lr_scheduler.py | arielclj/singa-easy | fd4bc601a5501062936f874df14711a3cefa1346 | [
"Apache-2.0"
] | 10 | 2020-04-06T09:56:20.000Z | 2022-03-21T09:18:51.000Z | from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.optim.lr_scheduler import CosineAnnealingLR
class GradualWarmupScheduler(_LRScheduler):
""" Gradually warm-up(increasing) learning rate in optimizer.
Proposed in 'Accurate, Large Minibatch SGD: T... | 39.839286 | 113 | 0.671896 | from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.optim.lr_scheduler import CosineAnnealingLR
class GradualWarmupScheduler(_LRScheduler):
def __init__(self, optimizer, warmup_epoch, multiplier=1.0, scheduler=None):
assert multiplier > 1., '... | true | true |
f708a43e245048f8b85402378a032274e63bb224 | 13,612 | py | Python | atomate/vasp/firetasks/glue_tasks.py | dongsenfo/atomate | 01558e8c3e38470c02bc8b50c0ee3aa6198e5206 | [
"BSD-3-Clause-LBNL"
] | null | null | null | atomate/vasp/firetasks/glue_tasks.py | dongsenfo/atomate | 01558e8c3e38470c02bc8b50c0ee3aa6198e5206 | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-04-09T20:55:30.000Z | 2019-04-09T21:30:24.000Z | atomate/vasp/firetasks/glue_tasks.py | dongsenfo/atomate | 01558e8c3e38470c02bc8b50c0ee3aa6198e5206 | [
"BSD-3-Clause-LBNL"
] | 3 | 2018-09-01T00:08:51.000Z | 2021-11-17T01:32:14.000Z | # coding: utf-8
from __future__ import division, print_function, unicode_literals, \
absolute_import
import glob
from pymatgen.analysis.elasticity.strain import Strain
from pymatgen.io.vasp import Vasprun, zpath
"""
This module defines tasks that acts as a glue between other vasp Firetasks to allow communicatio... | 41.754601 | 98 | 0.624082 |
from __future__ import division, print_function, unicode_literals, \
absolute_import
import glob
from pymatgen.analysis.elasticity.strain import Strain
from pymatgen.io.vasp import Vasprun, zpath
import gzip
import os
import re
from pymatgen import MPRester
from pymatgen.io.vasp.sets import get_vasprun_outca... | true | true |
f708a4b5c1c05df7983e5a7b61b02ba89c31901e | 550 | py | Python | experiments/issue488/issue488.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | 4 | 2019-04-23T10:41:35.000Z | 2019-10-27T05:14:42.000Z | experiments/issue488/issue488.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | null | null | null | experiments/issue488/issue488.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | 4 | 2018-01-16T00:00:22.000Z | 2019-11-01T23:35:01.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
import common_setup
CONFIGS = {
'astar_ipdb': [
'--search',
'astar(ipdb())'],
'astar_pdb': [
'--search',
'astar(pdb())'],
'astar_gapdb': [
'--search',
... | 18.965517 | 54 | 0.54 |
from downward import suites
import common_setup
CONFIGS = {
'astar_ipdb': [
'--search',
'astar(ipdb())'],
'astar_pdb': [
'--search',
'astar(pdb())'],
'astar_gapdb': [
'--search',
'astar(gapdb())'],
}
exp = common_setup... | true | true |
f708a57b69d36dd8f2b7f8ddd643b86675efe433 | 15,355 | py | Python | comment/tests/test_utils.py | abhiabhi94/Comment | 0956fb395399328ada5d35263307e452567b36aa | [
"MIT"
] | null | null | null | comment/tests/test_utils.py | abhiabhi94/Comment | 0956fb395399328ada5d35263307e452567b36aa | [
"MIT"
] | null | null | null | comment/tests/test_utils.py | abhiabhi94/Comment | 0956fb395399328ada5d35263307e452567b36aa | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
from django.utils import timezone
from django.core import signing, mail
from django.contrib.sites.shortcuts import get_current_site
from django.contrib.auth.models import AnonymousUser
from django.shortcuts import reverse
from comment.conf import settings
... | 42.068493 | 114 | 0.696711 | from unittest import TestCase
from unittest.mock import patch
from django.utils import timezone
from django.core import signing, mail
from django.contrib.sites.shortcuts import get_current_site
from django.contrib.auth.models import AnonymousUser
from django.shortcuts import reverse
from comment.conf import settings
... | true | true |
f708a65e39503b03d6e8b8b84ad95a20f948f77c | 224 | py | Python | example_project/carts/admin.py | aino/django-nimda | 334709c64cb253c0d1b5676850bd2d8ff9b8bea4 | [
"BSD-3-Clause"
] | null | null | null | example_project/carts/admin.py | aino/django-nimda | 334709c64cb253c0d1b5676850bd2d8ff9b8bea4 | [
"BSD-3-Clause"
] | 7 | 2020-06-05T17:01:18.000Z | 2022-03-11T23:12:34.000Z | example_project/carts/admin.py | aino/django-nimda | 334709c64cb253c0d1b5676850bd2d8ff9b8bea4 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from .models import Cart, CartItem
class CartItemInline(admin.TabularInline):
model = CartItem
@admin.register(Cart)
class CartAdmin(admin.ModelAdmin):
inlines = [CartItemInline]
| 18.666667 | 42 | 0.772321 | from django.contrib import admin
from .models import Cart, CartItem
class CartItemInline(admin.TabularInline):
model = CartItem
@admin.register(Cart)
class CartAdmin(admin.ModelAdmin):
inlines = [CartItemInline]
| true | true |
f708a70e28dc3d5e7d2e9aa1e23cc76bac08c8a2 | 8,167 | py | Python | pyflux/arma/tests/test_arima_laplace.py | ThomasHoppe/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 2,091 | 2016-04-01T02:52:10.000Z | 2022-03-29T11:38:15.000Z | pyflux/arma/tests/test_arima_laplace.py | EricSchles/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 160 | 2016-04-26T14:52:18.000Z | 2022-03-15T02:09:07.000Z | pyflux/arma/tests/test_arima_laplace.py | EricSchles/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 264 | 2016-05-02T14:03:31.000Z | 2022-03-29T07:48:20.000Z | import numpy as np
from pyflux.arma import ARIMA
from pyflux.families import Laplace
noise = np.random.normal(0,1,100)
data = np.zeros(100)
for i in range(1,len(data)):
data[i] = 0.9*data[i-1] + noise[i]
def test_no_terms():
"""
Tests an ARIMA model with no AR or MA terms, and that
the latent variabl... | 42.536458 | 113 | 0.691564 | import numpy as np
from pyflux.arma import ARIMA
from pyflux.families import Laplace
noise = np.random.normal(0,1,100)
data = np.zeros(100)
for i in range(1,len(data)):
data[i] = 0.9*data[i-1] + noise[i]
def test_no_terms():
model = ARIMA(data=data, ar=0, ma=0, family=Laplace())
x = model.fit()
asser... | true | true |
f708a81d6a696ba3b827ec15b66d87f5d15958c5 | 2,048 | py | Python | kernel/examples/handler/component/vert_secureboost.py | rinceyuan/WeFe | 8482cb737cb7ba37b2856d184cd42c1bd35a6318 | [
"Apache-2.0"
] | 39 | 2021-10-12T01:43:27.000Z | 2022-03-28T04:46:35.000Z | kernel/examples/handler/component/vert_secureboost.py | rinceyuan/WeFe | 8482cb737cb7ba37b2856d184cd42c1bd35a6318 | [
"Apache-2.0"
] | 6 | 2021-10-14T02:11:47.000Z | 2022-03-23T02:41:50.000Z | kernel/examples/handler/component/vert_secureboost.py | rinceyuan/WeFe | 8482cb737cb7ba37b2856d184cd42c1bd35a6318 | [
"Apache-2.0"
] | 10 | 2021-10-14T09:36:03.000Z | 2022-02-10T11:05:12.000Z | # Copyright 2021 Tianmian Tech. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 39.384615 | 74 | 0.751953 |
from common.python.utils import log_utils
from kernel.components.boosting.param import BoostingTreeParam
from kernel.examples.handler.component.component_base import Component
from kernel.examples.handler.interface import Input
from kernel.examples.handler.interface import Output
LOGGER = l... | true | true |
f708a978e4ac5b441e8bee7b68aea9849977d69b | 2,239 | py | Python | src/attendance.py | Subdue0/pyqt5-demo | aae13e1ab2ffcb2383303028a9c0dd3e3e153d38 | [
"MIT"
] | null | null | null | src/attendance.py | Subdue0/pyqt5-demo | aae13e1ab2ffcb2383303028a9c0dd3e3e153d38 | [
"MIT"
] | null | null | null | src/attendance.py | Subdue0/pyqt5-demo | aae13e1ab2ffcb2383303028a9c0dd3e3e153d38 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QApplication
from Page.page import Page
class Attendance(Page):
def __init__(self, parent=None):
super(Page, self).__init__(parent)
self.setupUi(self)
self.getDataFromDB()
self.setRowHeader(self.row_sum)
self.field = ['编号', '姓名', '迟到', '早退', '病假'... | 22.846939 | 86 | 0.678428 |
from PyQt5.QtWidgets import QApplication
from Page.page import Page
class Attendance(Page):
def __init__(self, parent=None):
super(Page, self).__init__(parent)
self.setupUi(self)
self.getDataFromDB()
self.setRowHeader(self.row_sum)
self.field = ['编号', '姓名', '迟到', '早退', '病假', '事假', '旷工']
self.se... | true | true |
f708a9b201c27dea1e1329bdb0da07f50d3fea38 | 22 | py | Python | battleship/version.py | nickknudsen/battleship-python | 788cf76c3349200f8a1e15f49ee2eee74fdb6e86 | [
"MIT"
] | 315 | 2016-12-29T17:42:39.000Z | 2022-03-24T03:57:41.000Z | battleship/version.py | nickknudsen/battleship-python | 788cf76c3349200f8a1e15f49ee2eee74fdb6e86 | [
"MIT"
] | 147 | 2017-01-19T17:45:08.000Z | 2022-03-31T15:00:29.000Z | battleship/version.py | nickknudsen/battleship-python | 788cf76c3349200f8a1e15f49ee2eee74fdb6e86 | [
"MIT"
] | 112 | 2016-12-29T12:56:52.000Z | 2022-03-16T08:05:49.000Z | __version__ = "1.3.2"
| 11 | 21 | 0.636364 | __version__ = "1.3.2"
| true | true |
f708aa27c15636ec86e4c678122b23f286f52bb0 | 3,204 | py | Python | day15/day15.py | Daggy1234/AOC2020 | 4ee5cebb6640540f8a3b20e7c7ea37196d4c4ce9 | [
"MIT"
] | 1 | 2021-01-17T17:59:19.000Z | 2021-01-17T17:59:19.000Z | day15/day15.py | Daggy1234/AOC2020 | 4ee5cebb6640540f8a3b20e7c7ea37196d4c4ce9 | [
"MIT"
] | null | null | null | day15/day15.py | Daggy1234/AOC2020 | 4ee5cebb6640540f8a3b20e7c7ea37196d4c4ce9 | [
"MIT"
] | null | null | null | import functools
import time
def timer(function):
@functools.wraps(function)
def wrapper(*args, **kwargs) -> float:
time_list = []
ans = None
for i in range(0, 10):
start = time.perf_counter()
ans = function(*args, **kwargs)
end = time.perf_counter()
... | 26.7 | 71 | 0.485955 | import functools
import time
def timer(function):
@functools.wraps(function)
def wrapper(*args, **kwargs) -> float:
time_list = []
ans = None
for i in range(0, 10):
start = time.perf_counter()
ans = function(*args, **kwargs)
end = time.perf_counter()
... | true | true |
f708aaad810d4f1c0c9891020fc2450dbb9ec8db | 1,849 | py | Python | IRIS_data_download/IRIS_download_support/obspy/imaging/scripts/plot.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/imaging/scripts/plot.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/imaging/scripts/plot.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple script to plot waveforms in one or more files.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
from argparse import ArgumentParser
from obspy import Stream, _... | 36.254902 | 79 | 0.592212 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import *
from argparse import ArgumentParser
from obspy import Stream, __version__, read
from obspy.core.util.base import ENTRY_POINTS
from obspy.core.util.misc import MatplotlibBacken... | true | true |
f708aaf2d466e75e865e8659b2df3dd9d95762c0 | 7,025 | py | Python | code/plotting/plot_evalrep.py | modichirag/21cm_cleaning | 1615fea4e2d617bb6ef00770a49698901227daa8 | [
"MIT"
] | 1 | 2019-08-27T10:05:41.000Z | 2019-08-27T10:05:41.000Z | code/plotting/plot_evalrep.py | modichirag/21cm_cleaning | 1615fea4e2d617bb6ef00770a49698901227daa8 | [
"MIT"
] | null | null | null | code/plotting/plot_evalrep.py | modichirag/21cm_cleaning | 1615fea4e2d617bb6ef00770a49698901227daa8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Plots the power spectra and Fourier-space biases for the HI.
#
import numpy as np
import os, sys
import matplotlib.pyplot as plt
from pmesh.pm import ParticleMesh
from scipy.interpolate import InterpolatedUnivariateSpline as ius
from nbodykit.lab import BigFileMesh, BigFileCatalog, FFTPower
f... | 36.21134 | 132 | 0.611103 |
import numpy as np
import os, sys
import matplotlib.pyplot as plt
from pmesh.pm import ParticleMesh
from scipy.interpolate import InterpolatedUnivariateSpline as ius
from nbodykit.lab import BigFileMesh, BigFileCatalog, FFTPower
from nbodykit.cosmology import Planck15, EHPower, Cosmology
sys.path.append('../utils/... | true | true |
f708ab43517a33dfe1a59f1d6d385c2e637e41da | 4,892 | py | Python | designate/tests/test_backend/test_nsd4.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | designate/tests/test_backend/test_nsd4.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | designate/tests/test_backend/test_nsd4.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Artom Lifshitz <artom.lifshitz@enovance.com>
#
# 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.... | 35.194245 | 79 | 0.613042 |
import os
import socket
import ssl
import eventlet
import fixtures
from mock import MagicMock
from designate import exceptions
from designate import objects
from designate.tests.test_backend import BackendTestCase
from designate.tests import resources
from designate.backend import impl_nsd4
class NS... | true | true |
f708ad4593250f5cec6499371c6a716dfeb0eb8b | 1,603 | py | Python | generic_link_tracking/migrations/0001_initial.py | jonatron/django_generic_links | 71c720b47380a665973543ef69109d34015e5069 | [
"MIT"
] | null | null | null | generic_link_tracking/migrations/0001_initial.py | jonatron/django_generic_links | 71c720b47380a665973543ef69109d34015e5069 | [
"MIT"
] | null | null | null | generic_link_tracking/migrations/0001_initial.py | jonatron/django_generic_links | 71c720b47380a665973543ef69109d34015e5069 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='GenericLink',
fields=... | 37.27907 | 114 | 0.561447 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='GenericLink',
fields=[
('id'... | true | true |
f708ad495ce75529097465bc672b71eaac2e14bc | 12,548 | py | Python | custom_components/heartbeat/sensor.py | HausNet/hausmon-hass | 3342fa4d01d3962ea6b07a143d64ffc61d07db05 | [
"MIT"
] | null | null | null | custom_components/heartbeat/sensor.py | HausNet/hausmon-hass | 3342fa4d01d3962ea6b07a143d64ffc61d07db05 | [
"MIT"
] | null | null | null | custom_components/heartbeat/sensor.py | HausNet/hausmon-hass | 3342fa4d01d3962ea6b07a143d64ffc61d07db05 | [
"MIT"
] | null | null | null | """Support for monitoring the local system for anomalous events."""
from __future__ import annotations
import asyncio
import time
from dataclasses import dataclass
import datetime
import logging
from typing import Any, Dict, Optional, List
import pprint
import voluptuous as vol
from homeassistant.components import p... | 35.749288 | 80 | 0.626474 | from __future__ import annotations
import asyncio
import time
from dataclasses import dataclass
import datetime
import logging
from typing import Any, Dict, Optional, List
import pprint
import voluptuous as vol
from homeassistant.components import persistent_notification
from homeassistant.components.binary_sensor i... | true | true |
f708ad710b2525cc93f4cc91eba0c88665a4cb0b | 710 | py | Python | app/core/management/commands/wait_for_db.py | Prajwol-Chhetri/recipe-app-api | db09cd7dfe27c68253428ae8e36fe125399aba5b | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | Prajwol-Chhetri/recipe-app-api | db09cd7dfe27c68253428ae8e36fe125399aba5b | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | Prajwol-Chhetri/recipe-app-api | db09cd7dfe27c68253428ae8e36fe125399aba5b | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until the database is avaialable"""
def handle(self, *args, **options):
"""Handle the comman... | 30.869565 | 78 | 0.64507 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Waiting for database...')
db_conn = None
while not db_conn:
... | true | true |
f708adf43b497e49417c34ed43afcd34566bbb08 | 3,535 | py | Python | matrix_factorization/mf_keras.py | ashwanikumar04/ml-recommendation-engine | 57a7c0d5ac073b976e40c17d8892a4b7291d08ed | [
"MIT"
] | null | null | null | matrix_factorization/mf_keras.py | ashwanikumar04/ml-recommendation-engine | 57a7c0d5ac073b976e40c17d8892a4b7291d08ed | [
"MIT"
] | null | null | null | matrix_factorization/mf_keras.py | ashwanikumar04/ml-recommendation-engine | 57a7c0d5ac073b976e40c17d8892a4b7291d08ed | [
"MIT"
] | null | null | null | import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Embedding, Dot, Add, Flatten
from tensorflow.keras.regularize... | 28.508065 | 89 | 0.655728 | import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Embedding, Dot, Add, Flatten
from tensorflow.keras.regularize... | true | true |
f708ae2427e8e0e2382e2ff741c4fafc8c35c6ef | 853 | py | Python | Config.py | dreasine/Lyrics_generator | c742f632b42d8cc0dfa87da2b32f3e4993b0b971 | [
"MIT"
] | null | null | null | Config.py | dreasine/Lyrics_generator | c742f632b42d8cc0dfa87da2b32f3e4993b0b971 | [
"MIT"
] | null | null | null | Config.py | dreasine/Lyrics_generator | c742f632b42d8cc0dfa87da2b32f3e4993b0b971 | [
"MIT"
] | null | null | null | #coding:utf-8
class Config(object):
init_scale = 0.04
learning_rate = 0.001
max_grad_norm = 15
num_layers = 3
num_steps = 25 # number of steps to unroll the RNN for
hidden_size = 1000 # size of hidden layer of neurons
iteration = 40
save_freq = 5 #The step (counted by the number of iter... | 38.772727 | 107 | 0.701055 |
class Config(object):
init_scale = 0.04
learning_rate = 0.001
max_grad_norm = 15
num_layers = 3
num_steps = 25
hidden_size = 1000
iteration = 40
save_freq = 5
keep_prob = 0.5
batch_size = 32
model_path = './model/Model'
save_time = 40
is_sample = True
... | true | true |
f708ae898023a88a8c10dbea4d3b4a59b626e0f7 | 5,366 | py | Python | TF/TARNN/test_tarnn.py | RandolphVI/Question-Difficulty-Prediction | 77b4b83b5bc747c5074926d7a37545a5d46ed343 | [
"Apache-2.0"
] | 29 | 2019-03-13T07:31:07.000Z | 2022-03-21T02:09:32.000Z | TF/TARNN/test_tarnn.py | RandolphVI/Question-Difficulty-Prediction | 77b4b83b5bc747c5074926d7a37545a5d46ed343 | [
"Apache-2.0"
] | 2 | 2020-12-30T02:17:00.000Z | 2021-04-20T08:59:03.000Z | TF/TARNN/test_tarnn.py | RandolphVI/Question-Difficulty-Prediction | 77b4b83b5bc747c5074926d7a37545a5d46ed343 | [
"Apache-2.0"
] | 11 | 2019-07-21T07:45:11.000Z | 2022-01-28T09:28:42.000Z | # -*- coding:utf-8 -*-
__author__ = 'Randolph'
import os
import sys
import time
import logging
sys.path.append('../')
logging.getLogger('tensorflow').disabled = True
import tensorflow as tf
from utils import checkmate as cm
from utils import data_helpers as dh
from utils import param_parser as parser
from sklearn.me... | 39.748148 | 110 | 0.623742 |
__author__ = 'Randolph'
import os
import sys
import time
import logging
sys.path.append('../')
logging.getLogger('tensorflow').disabled = True
import tensorflow as tf
from utils import checkmate as cm
from utils import data_helpers as dh
from utils import param_parser as parser
from sklearn.metrics import mean_squa... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.