hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0f3fe812918f68d02f24465d05f576b4763ed8 | 109 | py | Python | bin/run.py | shutingrz/cuckoo_malware_downloader | 18a0775f286f04502d5fe6842040ab34b5b89d7e | [
"MIT"
] | 1 | 2020-04-06T19:49:05.000Z | 2020-04-06T19:49:05.000Z | bin/run.py | shutingrz/cuckoo_malware_downloader | 18a0775f286f04502d5fe6842040ab34b5b89d7e | [
"MIT"
] | null | null | null | bin/run.py | shutingrz/cuckoo_malware_downloader | 18a0775f286f04502d5fe6842040ab34b5b89d7e | [
"MIT"
] | 2 | 2018-10-02T21:53:18.000Z | 2020-04-06T19:49:06.000Z | #!/usr/bin/env python3
from maldown import app
app.run(host='0.0.0.0', port=app.config['PORT'], debug=True)
| 21.8 | 60 | 0.697248 |
from maldown import app
app.run(host='0.0.0.0', port=app.config['PORT'], debug=True)
| true | true |
1c0f400e665b919b3797104ab4f75f1aff95dfa8 | 4,957 | py | Python | india.py | Gourab2927/virus | 862316fcb49e0ca4db4f3e89fad3ee8ffe8c4867 | [
"MIT"
] | 1 | 2020-08-11T12:30:00.000Z | 2020-08-11T12:30:00.000Z | india.py | Gourab2927/virus | 862316fcb49e0ca4db4f3e89fad3ee8ffe8c4867 | [
"MIT"
] | null | null | null | india.py | Gourab2927/virus | 862316fcb49e0ca4db4f3e89fad3ee8ffe8c4867 | [
"MIT"
] | null | null | null | from selenium import webdriver
from bs4 import BeautifulSoup
import time
from datetime import datetime
import sqlite3
from selenium.webdriver.chrome.options import Options
import urllib.request
# import shutil
from selenium.webdriver.common.action_chains import ActionChains
options = Options()
options.add_argument('--... | 36.448529 | 137 | 0.591285 | from selenium import webdriver
from bs4 import BeautifulSoup
import time
from datetime import datetime
import sqlite3
from selenium.webdriver.chrome.options import Options
import urllib.request
from selenium.webdriver.common.action_chains import ActionChains
options = Options()
options.add_argument('--headless')
optio... | true | true |
1c0f4035e0f6adc33bc595158f9aabc95cc52e80 | 34,271 | py | Python | welib/tools/spectral.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 24 | 2019-07-24T23:37:10.000Z | 2022-03-30T20:40:40.000Z | welib/tools/spectral.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | null | null | null | welib/tools/spectral.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 11 | 2019-03-14T13:47:04.000Z | 2022-03-31T15:47:27.000Z | # Tools for spectral analysis of a real valued signal.
#
# The functions in this file were adapted from the python package scipy according to the following license:
#
# License:
# Copyright 2001, 2002 Enthought, Inc.
# All rights reserved.
#
# Copyright 2003-2013 SciPy Developers.
# All rights reserved.
#
# R... | 35.62474 | 748 | 0.577865 |
from __future__ import division, print_function, absolute_import
import numpy as np
from six import string_types
__all__ = ['fft_wrap','welch', 'psd', 'fft_amplitude']
__all__ += ['pwelch', 'csd', 'coherence']
__all__ += ['fnextpow2']
__all__ += ['hann','hamming','boxcar','general_hamming','get_window']
__all__ += ... | true | true |
1c0f41123e2313d9db6f5e846d133ecdebc7f1af | 4,760 | py | Python | python/paddle/vision/datasets/flowers.py | Huangheyl/Paddle | a1b640bc66a5cc9583de503e7406aeba67565e8d | [
"Apache-2.0"
] | 8 | 2019-06-16T12:36:11.000Z | 2021-03-05T05:33:21.000Z | python/paddle/vision/datasets/flowers.py | zlsh80826/Paddle | c560a7d57aad990f374ebadd330351f18e2ca65f | [
"Apache-2.0"
] | 1 | 2020-09-10T09:05:52.000Z | 2020-09-10T09:06:22.000Z | python/paddle/vision/datasets/flowers.py | zlsh80826/Paddle | c560a7d57aad990f374ebadd330351f18e2ca65f | [
"Apache-2.0"
] | 25 | 2019-12-07T02:14:14.000Z | 2021-12-30T06:16:30.000Z | # Copyright (c) 2020 PaddlePaddle 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 app... | 36.335878 | 94 | 0.653361 |
from __future__ import print_function
import os
import io
import tarfile
import numpy as np
import scipy.io as scio
from PIL import Image
from paddle.io import Dataset
from paddle.dataset.common import _check_exists_and_download
__all__ = ["Flowers"]
DATA_URL = 'http://paddlemodels.bj.bcebos.com/flowers/102flowers... | true | true |
1c0f41127792580391a5ca5c77468f1bd9bec693 | 989 | py | Python | BubbleSort.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | 14 | 2020-10-15T21:47:18.000Z | 2021-12-01T06:06:51.000Z | BubbleSort.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | null | null | null | BubbleSort.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | 4 | 2020-06-15T14:40:45.000Z | 2021-06-15T06:22:03.000Z | # GHC Codepath - Module SE101
# Sandbox 10
#!/bin/python3
import math
import os
import random
import re
import sys
# The function is expected to return an INTEGER.
# The function accepts INTEGER_ARRAY nums as parameter.
# Implement bubble sort to sort nums and return the
# number of swaps it took to sort nums.
de... | 20.604167 | 55 | 0.619818 |
import math
import os
import random
import re
import sys
def swap(num1, num2):
num1, num2 = num2, num1
def bubble_sort(nums):
last_index = len(nums)
swaps = 0
while last_index > 0:
for index in range(1, last_index):
if nums[index] < nums[index - 1]:
swap(nums[i... | true | true |
1c0f41dda17a3255d23ae8134d940a69dbe6c3db | 4,087 | py | Python | tools/nrtest-epanet/main.py | attilabibok/EPANET | 528e99a791c04a19ec838633f3ac25e4bfa6386b | [
"MIT"
] | null | null | null | tools/nrtest-epanet/main.py | attilabibok/EPANET | 528e99a791c04a19ec838633f3ac25e4bfa6386b | [
"MIT"
] | null | null | null | tools/nrtest-epanet/main.py | attilabibok/EPANET | 528e99a791c04a19ec838633f3ac25e4bfa6386b | [
"MIT"
] | null | null | null |
import numpy as np
import time
import cStringIO
import itertools as it
import epanet_reader as er
def result_compare(path_test, path_ref, comp_args):
isclose = True
close = 0
notclose = 0
equal = 0
total = 0
output = cStringIO.StringIO()
eps = np.finfo(float).eps
start = time.t... | 29.832117 | 128 | 0.624174 |
import numpy as np
import time
import cStringIO
import itertools as it
import epanet_reader as er
def result_compare(path_test, path_ref, comp_args):
isclose = True
close = 0
notclose = 0
equal = 0
total = 0
output = cStringIO.StringIO()
eps = np.finfo(float).eps
start = time.t... | false | true |
1c0f41f1a24718222e29200d7449aa83c09d18b7 | 1,746 | py | Python | research/cv/mobilenetV3_small_x1_0/src/config.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/mobilenetV3_small_x1_0/src/config.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/mobilenetV3_small_x1_0/src/config.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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... | 29.59322 | 78 | 0.641466 | from easydict import EasyDict as ed
config_gpu = ed({
"num_classes": 1000,
"image_height": 224,
"image_width": 224,
"batch_size": 600,
"epoch_size": 370,
"warmup_epochs": 4,
"lr": 0.005,
"momentum": 0.9,
"weight_decay": 4e-5,
"label_smooth": 0.1,
"loss_scale": 1024,
"sav... | true | true |
1c0f433f57fdc634216bc227329c303af7735d5d | 28,159 | py | Python | GUI/Basic-train/QtPandas/qtpandas/models/DataFrameModel.py | muyuuuu/PyQt-learn | a9134566505c88ae9d46ae23480b140c8c911c33 | [
"Apache-2.0"
] | 132 | 2016-12-07T15:34:30.000Z | 2022-03-22T17:58:20.000Z | GUI/Basic-train/QtPandas/qtpandas/models/DataFrameModel.py | muyuuuu/PyQt-learn | a9134566505c88ae9d46ae23480b140c8c911c33 | [
"Apache-2.0"
] | 35 | 2016-12-07T14:01:30.000Z | 2018-09-12T10:14:42.000Z | GUI/Basic-train/QtPandas/qtpandas/models/DataFrameModel.py | muyuuuu/PyQt-learn | a9134566505c88ae9d46ae23480b140c8c911c33 | [
"Apache-2.0"
] | 60 | 2016-12-12T02:21:47.000Z | 2022-03-02T08:59:29.000Z | # -*- coding: utf-8 -*-
"""
Easy integration of DataFrame into pyqt framework
@author: Jev Kuznetsov, Matthias Ludwig - Datalyze Solutions
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import range... | 35.8257 | 156 | 0.612841 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import range
from builtins import super
from builtins import int
from builtins import round
from builtins import str
from future import standard_library
sta... | true | true |
1c0f4376b727586ce488b344ff234a66b2841b36 | 3,832 | py | Python | test/self_rpc.py | egmkang/koala | 70ea68c0d4380242c61faa8a6f023fa248049ec8 | [
"MIT"
] | 15 | 2021-06-02T12:43:26.000Z | 2022-01-24T19:14:02.000Z | test/self_rpc.py | egmkang/flash | 70ea68c0d4380242c61faa8a6f023fa248049ec8 | [
"MIT"
] | 1 | 2021-06-14T10:08:46.000Z | 2021-06-14T10:08:46.000Z | test/self_rpc.py | egmkang/flash | 70ea68c0d4380242c61faa8a6f023fa248049ec8 | [
"MIT"
] | 1 | 2021-01-20T06:38:01.000Z | 2021-01-20T06:38:01.000Z | from abc import abstractmethod
import asyncio
import random
from koala.server import koala_host
from koala.server.actor_interface import ActorInterface
from koala.server.actor_base import ActorWithStrKey
from koala.server.rpc_meta import *
from koala.placement.placement import Placement
from koala.pd.simple import Self... | 25.210526 | 104 | 0.674582 | from abc import abstractmethod
import asyncio
import random
from koala.server import koala_host
from koala.server.actor_interface import ActorInterface
from koala.server.actor_base import ActorWithStrKey
from koala.server.rpc_meta import *
from koala.placement.placement import Placement
from koala.pd.simple import Self... | true | true |
1c0f43ed46c344376de51a379514a12a8f6d08ce | 4,653 | py | Python | tools/regraphnet/src/inference.py | tomerwei/Fusion360GalleryDataset | 3e1d58920ac56d271c01a7ba05749c5a05097152 | [
"RSA-MD"
] | 1 | 2021-03-13T17:56:44.000Z | 2021-03-13T17:56:44.000Z | tools/regraphnet/src/inference.py | tomerwei/Fusion360GalleryDataset | 3e1d58920ac56d271c01a7ba05749c5a05097152 | [
"RSA-MD"
] | null | null | null | tools/regraphnet/src/inference.py | tomerwei/Fusion360GalleryDataset | 3e1d58920ac56d271c01a7ba05749c5a05097152 | [
"RSA-MD"
] | null | null | null | from __future__ import division
from __future__ import print_function
import os
import json
import time
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from train import *
def load_graph_pair(path_tar,path_cur,bbox):
action_type_dict={'CutFeatureOperation':1... | 41.918919 | 162 | 0.67032 | from __future__ import division
from __future__ import print_function
import os
import json
import time
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from train import *
def load_graph_pair(path_tar,path_cur,bbox):
action_type_dict={'CutFeatureOperation':1... | true | true |
1c0f4462b760879595a9fd6850213a0dc0ff749e | 5,638 | py | Python | src/configuration.py | vanvibig/SeqGAN-Tensorflow | 58340407209e3da7a9f1046141dc43d63bac4263 | [
"MIT"
] | null | null | null | src/configuration.py | vanvibig/SeqGAN-Tensorflow | 58340407209e3da7a9f1046141dc43d63bac4263 | [
"MIT"
] | null | null | null | src/configuration.py | vanvibig/SeqGAN-Tensorflow | 58340407209e3da7a9f1046141dc43d63bac4263 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ configuration.py ]
# Synopsis [ Training configurations and Hyperparameters for the model. ]
# Author [ Ting-Wei Liu (Andi611) ]
# Copyright [ Copyleft(c), ... | 67.927711 | 182 | 0.690138 |
import argparse
def get_config():
parser = argparse.ArgumentParser(description="daisy configurations")
parser.add_argument('--pre_train', action='store_true', help='activate generator supervise maximum likelihood estimation training mode.')
parser.add_argument('--gan_train', action='store_true', help='activate ... | true | true |
1c0f44b8fc966bb9cff1c1c2c531aca4cc8dc5cc | 1,256 | py | Python | apps/oidc/error_handlers.py | onyxhealth/safhir-vmi | 60ba90e9e8ba00347e0dc32e3061da5285df4ade | [
"Apache-2.0"
] | null | null | null | apps/oidc/error_handlers.py | onyxhealth/safhir-vmi | 60ba90e9e8ba00347e0dc32e3061da5285df4ade | [
"Apache-2.0"
] | 9 | 2021-03-19T11:43:09.000Z | 2022-03-12T00:38:43.000Z | apps/oidc/error_handlers.py | onyxhealth/safhir-vmi | 60ba90e9e8ba00347e0dc32e3061da5285df4ade | [
"Apache-2.0"
] | null | null | null | # error_handlers.py
from urllib.parse import urlsplit, urlunsplit
from oauthlib.oauth2.rfc6749.grant_types import OIDCNoPrompt
from django.utils.deprecation import MiddlewareMixin
from django.http.request import QueryDict
from django.contrib.auth.views import LogoutView
from django.shortcuts import redirect
from .excep... | 41.866667 | 107 | 0.660828 | from urllib.parse import urlsplit, urlunsplit
from oauthlib.oauth2.rfc6749.grant_types import OIDCNoPrompt
from django.utils.deprecation import MiddlewareMixin
from django.http.request import QueryDict
from django.contrib.auth.views import LogoutView
from django.shortcuts import redirect
from .exceptions import Authent... | true | true |
1c0f44c80b3f3ac80769c8f6aa35d62420cba10d | 57,665 | py | Python | rpython/rtyper/lltypesystem/rffi.py | CAS-Atlantic/pypy | 0988788dd911ff0d5b1cfcf0657412810168d37e | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-07-19T17:42:42.000Z | 2021-07-19T17:42:42.000Z | rpython/rtyper/lltypesystem/rffi.py | CAS-Atlantic/pypy | 0988788dd911ff0d5b1cfcf0657412810168d37e | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | rpython/rtyper/lltypesystem/rffi.py | CAS-Atlantic/pypy | 0988788dd911ff0d5b1cfcf0657412810168d37e | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import py
from rpython.annotator import model as annmodel
from rpython.rtyper.llannotation import SomePtr
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem import ll2ctypes
from rpython.rtyper.lltypesystem.llmemory import cast_ptr_to_adr
from rpython.rtyper.lltypesystem.llmemory import ite... | 38.857817 | 95 | 0.628562 | import py
from rpython.annotator import model as annmodel
from rpython.rtyper.llannotation import SomePtr
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem import ll2ctypes
from rpython.rtyper.lltypesystem.llmemory import cast_ptr_to_adr
from rpython.rtyper.lltypesystem.llmemory import ite... | false | true |
1c0f4659599f475941888446e46f43e8dec41da3 | 7,421 | py | Python | MCForecastTools.py | mholts1020/Challenge-5-module | d26eaac00b761bfc625e2e15573e26b256a9e843 | [
"Unlicense"
] | 1 | 2021-09-29T02:57:38.000Z | 2021-09-29T02:57:38.000Z | MCForecastTools.py | mholts1020/Challenge-5-module | d26eaac00b761bfc625e2e15573e26b256a9e843 | [
"Unlicense"
] | 2 | 2022-02-15T01:32:25.000Z | 2022-02-18T19:38:06.000Z | MCForecastTools.py | mholts1020/Challenge-5-module | d26eaac00b761bfc625e2e15573e26b256a9e843 | [
"Unlicense"
] | 1 | 2022-02-08T02:03:58.000Z | 2022-02-08T02:03:58.000Z | # Import libraries and dependencies
import numpy as np
import pandas as pd
import os
import alpaca_trade_api as tradeapi
import datetime as dt
import pytz
class MCSimulation:
"""
A Python class for runnning Monte Carlo simulation on portfolio price data.
...
Attributes
---... | 43.145349 | 136 | 0.629026 | import numpy as np
import pandas as pd
import os
import alpaca_trade_api as tradeapi
import datetime as dt
import pytz
class MCSimulation:
def __init__(self, portfolio_data, weights="", num_simulation=1000, num_trading_days=252):
if not isinstance(portfolio_data, pd.DataFra... | true | true |
1c0f47e0e694386de378f641d01e2231ac86045e | 2,899 | py | Python | oldCode/scheduledNotification.py | cdslipp/coursewatch | 86b02e052d49fb3c995e7c8a8c944b672b8cba81 | [
"MIT"
] | null | null | null | oldCode/scheduledNotification.py | cdslipp/coursewatch | 86b02e052d49fb3c995e7c8a8c944b672b8cba81 | [
"MIT"
] | null | null | null | oldCode/scheduledNotification.py | cdslipp/coursewatch | 86b02e052d49fb3c995e7c8a8c944b672b8cba81 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
import pandas as pd
import datetime
import sendmail
now = datetime.datetime.now()
def scrapeTable(url):
#load and scrape
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html, 'lxml')
table = soup.table
subtable = table.tab... | 30.840426 | 152 | 0.601242 | import requests
from bs4 import BeautifulSoup
import pandas as pd
import datetime
import sendmail
now = datetime.datetime.now()
def scrapeTable(url):
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html, 'lxml')
table = soup.table
subtable = table.table
dfs = pd.r... | true | true |
1c0f47e8afddb87d2ab3bb0841fd799001a26eda | 10,925 | py | Python | src/editTeam.py | the-gamecoders/TheGameHub | b60b237a2626defda2240951f14074d13075c3c9 | [
"MIT"
] | null | null | null | src/editTeam.py | the-gamecoders/TheGameHub | b60b237a2626defda2240951f14074d13075c3c9 | [
"MIT"
] | null | null | null | src/editTeam.py | the-gamecoders/TheGameHub | b60b237a2626defda2240951f14074d13075c3c9 | [
"MIT"
] | 1 | 2020-11-15T14:24:43.000Z | 2020-11-15T14:24:43.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'editTeam.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# 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 import Q... | 43.525896 | 131 | 0.600183 |
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMessageBox
from teamSelection import Ui_OtherWindow
import sqlite3
conn=sqlite3.connect('TheGameHub.db')
curs=conn.cursor()
class Ui_OtherWindow1(object):
def setupUi(self, OtherWindow1):
OtherWindow1.setObjectName("Othe... | true | true |
1c0f4926ce2e6931f0dba8f79233c107cc683ff9 | 784 | py | Python | rlpyt/experiments/configs/mujoco/qpg/mujoco_ddpg.py | DilipA/rlpyt | edfd46484c56a47b4671006a16a642e6808da393 | [
"MIT"
] | null | null | null | rlpyt/experiments/configs/mujoco/qpg/mujoco_ddpg.py | DilipA/rlpyt | edfd46484c56a47b4671006a16a642e6808da393 | [
"MIT"
] | null | null | null | rlpyt/experiments/configs/mujoco/qpg/mujoco_ddpg.py | DilipA/rlpyt | edfd46484c56a47b4671006a16a642e6808da393 | [
"MIT"
] | 1 | 2020-06-23T14:13:40.000Z | 2020-06-23T14:13:40.000Z |
import copy
configs = dict()
config = dict(
agent=dict(
mu_model_kwargs=None,
q_model_kwargs=None,
),
algo=dict(
discount=0.99,
batch_size=100,
training_ratio=100,
target_update_tau=0.01,
target_update_interval=1,
policy_update_interval=1,
... | 20.102564 | 43 | 0.589286 |
import copy
configs = dict()
config = dict(
agent=dict(
mu_model_kwargs=None,
q_model_kwargs=None,
),
algo=dict(
discount=0.99,
batch_size=100,
training_ratio=100,
target_update_tau=0.01,
target_update_interval=1,
policy_update_interval=1,
... | true | true |
1c0f494a1830aabcc5c1cf0b372b905c3080fdf5 | 775 | py | Python | tests/conftest.py | lumbric/message_ix | bb357855f77e0f47ec8cccdd69b46ddec395f449 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | tests/conftest.py | lumbric/message_ix | bb357855f77e0f47ec8cccdd69b46ddec395f449 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | tests/conftest.py | lumbric/message_ix | bb357855f77e0f47ec8cccdd69b46ddec395f449 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
import message_ix
import pytest
# Use the fixtures test_mp, test_mp_props, and tmp_env from ixmp.testing
pytest_plugins = ['ixmp.testing']
# Hooks
def pytest_report_header(config, startdir):
"""Add the message_ix import path t... | 23.484848 | 77 | 0.729032 | try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
import message_ix
import pytest
pytest_plugins = ['ixmp.testing']
def pytest_report_header(config, startdir):
return 'message_ix location: {}'.format(Path(message_ix.__file__).parent)
@pytest.fixture(scope='session')
def te... | true | true |
1c0f496168869af443126ba177e24ce11cf59b3d | 2,127 | py | Python | app/api/v1/views/sales.py | Nicanor008/Store-Manager-API | 36a1a553d3740129f0ee2735f85e6a2be2abe835 | [
"MIT"
] | null | null | null | app/api/v1/views/sales.py | Nicanor008/Store-Manager-API | 36a1a553d3740129f0ee2735f85e6a2be2abe835 | [
"MIT"
] | 1 | 2018-10-23T11:02:05.000Z | 2018-10-23T14:24:52.000Z | app/api/v1/views/sales.py | Nicanor008/Store-Manager-API | 36a1a553d3740129f0ee2735f85e6a2be2abe835 | [
"MIT"
] | null | null | null | from flask import Flask, abort, request, make_response, jsonify, Blueprint
from flask_restful import Resource, Api
from flask_jwt_extended import (JWTManager, jwt_required, get_jwt_claims)
from app.api.v1.models.sales import SalesData, sales
from app.api.v1.models.products import products
# sales list
# sale = SalesDa... | 32.723077 | 100 | 0.630465 | from flask import Flask, abort, request, make_response, jsonify, Blueprint
from flask_restful import Resource, Api
from flask_jwt_extended import (JWTManager, jwt_required, get_jwt_claims)
from app.api.v1.models.sales import SalesData, sales
from app.api.v1.models.products import products
class Sales(Resource):
... | true | true |
1c0f4b7a9a2769de47945a20395c3469b47ce0fa | 2,201 | py | Python | typedb/logic/logic_manager.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 47 | 2019-01-22T19:17:13.000Z | 2021-02-06T15:39:59.000Z | typedb/logic/logic_manager.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 85 | 2019-01-22T14:51:34.000Z | 2021-04-08T15:41:43.000Z | typedb/logic/logic_manager.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 24 | 2019-01-22T13:21:42.000Z | 2021-03-02T18:06:03.000Z | #
# Copyright (C) 2021 Vaticle
#
# 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... | 40.759259 | 118 | 0.771922 | from typing import TYPE_CHECKING
import typedb_protocol.common.transaction_pb2 as transaction_proto
from typedb.api.logic.logic_manager import LogicManager
from typedb.common.rpc.request_builder import logic_manager_get_rule_req, logic_manager_get_rules_req, \
logic_manager_put_rule_req
from typedb.logic.rule imp... | true | true |
1c0f4bde3d005d3d34f256786247c6b4b8d21c55 | 7,668 | py | Python | backend/app.py | jiangyy12/application-tracking-system | 6de2d98351df65d43c09a5739c3c3dbdf3bf78d3 | [
"MIT"
] | 1 | 2021-10-17T16:00:20.000Z | 2021-10-17T16:00:20.000Z | backend/app.py | jiangyy12/application-tracking-system | 6de2d98351df65d43c09a5739c3c3dbdf3bf78d3 | [
"MIT"
] | 14 | 2021-11-01T17:34:51.000Z | 2021-11-16T02:48:03.000Z | backend/app.py | jiangyy12/application-tracking-system | 6de2d98351df65d43c09a5739c3c3dbdf3bf78d3 | [
"MIT"
] | 3 | 2021-11-01T18:00:49.000Z | 2021-11-16T19:57:26.000Z | #importing required python libraries
from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
from selenium import webdriver
from bs4 import BeautifulSoup
from itertools import islice
from webdriver_manager.chrome import ChromeDriverManager
from data.connection import query, insert, count, qu... | 31.170732 | 108 | 0.572509 | from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
from selenium import webdriver
from bs4 import BeautifulSoup
from itertools import islice
from webdriver_manager.chrome import ChromeDriverManager
from data.connection import query, insert, count, querySchool, countProgram, queryItem, q... | true | true |
1c0f4c89083ea579e18fc60f12e2b9773d46a130 | 399 | py | Python | examples/swearfilter.py | SKlayer/PySpigot | 83290d400f791dc594b8cb0d1dc8b2cd7539a10e | [
"Apache-2.0"
] | null | null | null | examples/swearfilter.py | SKlayer/PySpigot | 83290d400f791dc594b8cb0d1dc8b2cd7539a10e | [
"Apache-2.0"
] | null | null | null | examples/swearfilter.py | SKlayer/PySpigot | 83290d400f791dc594b8cb0d1dc8b2cd7539a10e | [
"Apache-2.0"
] | null | null | null | #Bukkit Imports
from org.bukkit.event.player import AsyncPlayerChatEvent
config = configs.loadConfig('swearfilter.yml')
swear_words = config.getStringList('swear-words')
def player_chat(event):
message = event.getMessage().lower()
for word in message.split():
if word in swear_words:
event... | 28.5 | 58 | 0.75188 | from org.bukkit.event.player import AsyncPlayerChatEvent
config = configs.loadConfig('swearfilter.yml')
swear_words = config.getStringList('swear-words')
def player_chat(event):
message = event.getMessage().lower()
for word in message.split():
if word in swear_words:
event.setCancelled(Tr... | true | true |
1c0f4ca13accff2c9761269edd5ccff4ee32a6d0 | 5,713 | py | Python | surveymonkey/tests/surveys/test_surveys_mocks.py | Administrate/surveymonkey | 5312932c3984f4419af2d4d15e1a27349a1c6f45 | [
"MIT"
] | 4 | 2016-12-02T10:25:50.000Z | 2017-10-30T18:21:28.000Z | surveymonkey/tests/surveys/test_surveys_mocks.py | Administrate/surveymonkey | 5312932c3984f4419af2d4d15e1a27349a1c6f45 | [
"MIT"
] | 8 | 2016-11-08T10:56:03.000Z | 2019-04-12T09:35:26.000Z | surveymonkey/tests/surveys/test_surveys_mocks.py | Administrate/surveymonkey | 5312932c3984f4419af2d4d15e1a27349a1c6f45 | [
"MIT"
] | 1 | 2018-02-19T01:11:56.000Z | 2018-02-19T01:11:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from expects import expect, equal, have_key, have_length
from surveymonkey.tests.mocks.surveys import SurveyListMock
class TestSurveyMocksCount(object): # Quis custodiet ipsos custodes?
def test_survey_count_is_equal_to_total... | 43.946154 | 91 | 0.742342 | from __future__ import absolute_import
from expects import expect, equal, have_key, have_length
from surveymonkey.tests.mocks.surveys import SurveyListMock
class TestSurveyMocksCount(object):
def test_survey_count_is_equal_to_total_surveys_when_total_is_less_than_per_page(self):
mock = SurveyListMock(... | true | true |
1c0f4cda7cf04019f4742fc043972ab165d763a1 | 1,032 | py | Python | Class4/behave-basics/features/steps/web_element_operations.py | techsparksguru/python_ci_automation | 65e66266fdf2c14f593c6f098a23770621faef41 | [
"MIT"
] | null | null | null | Class4/behave-basics/features/steps/web_element_operations.py | techsparksguru/python_ci_automation | 65e66266fdf2c14f593c6f098a23770621faef41 | [
"MIT"
] | 9 | 2020-02-13T09:14:12.000Z | 2022-01-13T03:17:03.000Z | Class4/behave-basics/features/steps/web_element_operations.py | techsparksguru/python_ci_automation | 65e66266fdf2c14f593c6f098a23770621faef41 | [
"MIT"
] | 1 | 2021-03-10T03:27:37.000Z | 2021-03-10T03:27:37.000Z | from behave import *
from selenium.webdriver.support.ui import Select
@step("I fill the form with values")
def step_impl(context):
context.browser.find_element_by_name("firstname").send_keys("Pradeep")
context.browser.find_element_by_name("lastname").send_keys("Kumar")
context.browser.find_element_by_id(... | 43 | 89 | 0.758721 | from behave import *
from selenium.webdriver.support.ui import Select
@step("I fill the form with values")
def step_impl(context):
context.browser.find_element_by_name("firstname").send_keys("Pradeep")
context.browser.find_element_by_name("lastname").send_keys("Kumar")
context.browser.find_element_by_id(... | true | true |
1c0f4e816b897884e2fe3173c29e80f1eed16508 | 1,669 | py | Python | auditbeat/tests/system/auditbeat.py | swift1911/beats | f9e06417b654c6e32bb7d05d34fb63b7a759f77a | [
"Apache-2.0"
] | 16 | 2018-08-22T03:29:31.000Z | 2021-09-05T14:01:10.000Z | auditbeat/tests/system/auditbeat.py | swift1911/beats | f9e06417b654c6e32bb7d05d34fb63b7a759f77a | [
"Apache-2.0"
] | 3 | 2018-09-06T16:02:08.000Z | 2020-06-24T13:27:55.000Z | auditbeat/tests/system/auditbeat.py | swift1911/beats | f9e06417b654c6e32bb7d05d34fb63b7a759f77a | [
"Apache-2.0"
] | 6 | 2018-10-31T06:55:01.000Z | 2021-02-06T18:50:04.000Z | import os
import shutil
import sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../metricbeat/tests/system'))
if os.name == "nt":
import win32file
from metricbeat import BaseTest as MetricbeatTest
class BaseTest(MetricbeatTest):
@classmethod
def setUpClass(self):
... | 30.345455 | 92 | 0.562612 | import os
import shutil
import sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../metricbeat/tests/system'))
if os.name == "nt":
import win32file
from metricbeat import BaseTest as MetricbeatTest
class BaseTest(MetricbeatTest):
@classmethod
def setUpClass(self):
... | true | true |
1c0f4f66a8b29f2af6bd4cbc86c68dd046db4f37 | 2,492 | py | Python | azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/account/models/compute_policy.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/account/models/compute_policy.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/account/models/compute_policy.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.852459 | 111 | 0.652087 |
from msrest.serialization import Model
class ComputePolicy(Model):
_validation = {
'name': {'readonly': True},
'object_id': {'readonly': True},
'object_type': {'readonly': True},
'max_degree_of_parallelism_per_job': {'minimum': 1},
'min_priority_per_job': {'minimum': 1},
... | true | true |
1c0f5030b164d5f84136d347f9a6a12f816b9056 | 137 | py | Python | taxii2/apps.py | MarkDavidson/taxii2_demo | c2a1ff52c93f236aa81254ed33193c27e6096a0b | [
"MIT"
] | null | null | null | taxii2/apps.py | MarkDavidson/taxii2_demo | c2a1ff52c93f236aa81254ed33193c27e6096a0b | [
"MIT"
] | null | null | null | taxii2/apps.py | MarkDavidson/taxii2_demo | c2a1ff52c93f236aa81254ed33193c27e6096a0b | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class Taxii2RestConfig(AppConfig):
name = 'taxii2_rest'
| 17.125 | 39 | 0.80292 | from __future__ import unicode_literals
from django.apps import AppConfig
class Taxii2RestConfig(AppConfig):
name = 'taxii2_rest'
| true | true |
1c0f516fc4f8c179a42f5ab8537748e11f238020 | 10,125 | py | Python | bddtests/steps/bdd_compose_util.py | shoheigold/fabric-starter | b79bb33b3f3cff893d592cbb60c93093db61320b | [
"Apache-2.0"
] | 33 | 2017-11-29T15:51:44.000Z | 2022-02-22T19:25:55.000Z | bddtests/steps/bdd_compose_util.py | shoheigold/fabric-starter | b79bb33b3f3cff893d592cbb60c93093db61320b | [
"Apache-2.0"
] | 3 | 2016-09-08T23:47:44.000Z | 2017-02-03T21:49:01.000Z | bddtests/steps/bdd_compose_util.py | shoheigold/fabric-starter | b79bb33b3f3cff893d592cbb60c93093db61320b | [
"Apache-2.0"
] | 84 | 2017-08-23T19:48:33.000Z | 2021-08-20T05:42:24.000Z | #
# Copyright IBM Corp. 2016 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 law or ... | 36.160714 | 140 | 0.715951 |
import os, time, re, requests
from bdd_request_util import httpGetToContainer, CORE_REST_PORT
from bdd_json_util import getAttributeFromJSON
from bdd_test_util import cli_call, bdd_log
class Container:
def __init__(self, name, ipAddress, envFromInspect, composeService):
self.name = name
self.ipAd... | true | true |
1c0f5177fd0cbf44e1f631465f1348743da72a15 | 627 | py | Python | manage.py | labarca/django-starter | bedf499b63312f1256cb8712cb2c14e5cf7a8666 | [
"MIT"
] | 1 | 2020-10-14T17:13:45.000Z | 2020-10-14T17:13:45.000Z | manage.py | labarca/django-starter | bedf499b63312f1256cb8712cb2c14e5cf7a8666 | [
"MIT"
] | 5 | 2021-03-30T13:49:04.000Z | 2021-09-22T19:22:25.000Z | manage.py | labarca/django-starter | bedf499b63312f1256cb8712cb2c14e5cf7a8666 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'starter.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | 28.5 | 73 | 0.682616 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'starter.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c0f52d4e12a0ea37adfb509d5ca3b63e8151ef6 | 4,779 | py | Python | openstack/tests/unit/smn/v2/test_proxy.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 43 | 2018-12-19T08:39:15.000Z | 2021-07-21T02:45:43.000Z | openstack/tests/unit/smn/v2/test_proxy.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 11 | 2019-03-17T13:28:56.000Z | 2020-09-23T23:57:50.000Z | openstack/tests/unit/smn/v2/test_proxy.py | wangrui1121/huaweicloud-sdk-python | 240abe00288760115d1791012d4e3c4592d77ad1 | [
"Apache-2.0"
] | 47 | 2018-12-19T05:14:25.000Z | 2022-03-19T15:28:30.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 t... | 39.495868 | 78 | 0.643231 |
import mock
from openstack.smn.v2 import _proxy
from openstack.smn.v2 import message_template as _message_template
from openstack.smn.v2 import subscription as _subscription
from openstack.smn.v2 import topic as _topic
from openstack.tests.unit import test_proxy_base2
class TestSMNProxy(test_proxy_base2.TestProxyBa... | true | true |
1c0f52dfffbb87caeda3d44df743bd0dbfbacd3a | 5,205 | py | Python | scripts/dist_utils.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 2 | 2021-08-04T01:04:06.000Z | 2021-08-04T01:04:08.000Z | scripts/dist_utils.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | null | null | null | scripts/dist_utils.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Extreme Networks, 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 appli... | 30.086705 | 98 | 0.602498 |
from __future__ import absolute_import
import os
import re
import sys
from distutils.version import StrictVersion
#
# TODO: Why can't this script rely on 3rd party dependencies? Is it because it has to import
PY3 = sys.version_info[0] == 3
if PY3:
text_type = str
else:
text_type = unicode
GET_PIP = 'curl... | true | true |
1c0f52fcf9b296e3c58ad4ae764f793580a6a7dc | 2,550 | py | Python | LintCode/Majority_ElementIII.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 87 | 2015-07-15T20:41:09.000Z | 2022-03-08T13:55:38.000Z | LintCode/Majority_ElementIII.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 59 | 2015-03-19T22:26:41.000Z | 2015-07-25T17:58:08.000Z | LintCode/Majority_ElementIII.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 45 | 2015-07-15T20:41:12.000Z | 2022-02-01T20:18:07.000Z | '''
Given an array of integers and a number k, the majority number is the number that occurs more than 1/k of the size of the array.
Find it.
Have you met this question in a real interview? Yes
Example
Given [3,1,2,3,2,3,3,4,4,4] and k=3, return 3.
Note
There is only one majority number in the array.
'''
# Best Sol... | 29.310345 | 128 | 0.516471 | '''
Given an array of integers and a number k, the majority number is the number that occurs more than 1/k of the size of the array.
Find it.
Have you met this question in a real interview? Yes
Example
Given [3,1,2,3,2,3,3,4,4,4] and k=3, return 3.
Note
There is only one majority number in the array.
'''
class Solu... | false | true |
1c0f54c44b534764580e80708236fc778972a604 | 1,774 | py | Python | tests/test_cli_update_recipe.py | lluft/tilesets-cli | b47fe224be8ea7f8c30ed9f32e6ef062ccd1b093 | [
"BSD-2-Clause"
] | null | null | null | tests/test_cli_update_recipe.py | lluft/tilesets-cli | b47fe224be8ea7f8c30ed9f32e6ef062ccd1b093 | [
"BSD-2-Clause"
] | null | null | null | tests/test_cli_update_recipe.py | lluft/tilesets-cli | b47fe224be8ea7f8c30ed9f32e6ef062ccd1b093 | [
"BSD-2-Clause"
] | null | null | null | from click.testing import CliRunner
from unittest import mock
import pytest
from tilesets.cli import update_recipe
class MockResponse():
def __init__(self):
self.status_code = 201
def MockResponse(self):
return self
@pytest.mark.usefixtures("token_environ")
def test_cli_update_recipe_no_rec... | 34.115385 | 109 | 0.71646 | from click.testing import CliRunner
from unittest import mock
import pytest
from tilesets.cli import update_recipe
class MockResponse():
def __init__(self):
self.status_code = 201
def MockResponse(self):
return self
@pytest.mark.usefixtures("token_environ")
def test_cli_update_recipe_no_rec... | true | true |
1c0f55120fc1a5bbea46d330d20202ab2a92ed98 | 2,934 | py | Python | damask_plot/parser.py | lukas-koschmieder/damask_plot | 1536a41fd06900bfd8ef9ceb6b45f005c696800b | [
"MIT"
] | 5 | 2019-05-13T11:45:25.000Z | 2021-07-04T10:15:10.000Z | damask_plot/parser.py | lukas-koschmieder/damask_plot | 1536a41fd06900bfd8ef9ceb6b45f005c696800b | [
"MIT"
] | null | null | null | damask_plot/parser.py | lukas-koschmieder/damask_plot | 1536a41fd06900bfd8ef9ceb6b45f005c696800b | [
"MIT"
] | 3 | 2019-05-13T15:06:25.000Z | 2021-02-10T11:17:29.000Z | # Copyright (c) 2015 Mingxuan Lin
# Copyright (c) 2019 Lukas Koschmieder
from .label import _Label as L
from parsimonious.grammar import Grammar, NodeVisitor
import re
rules = """
main = element+
element = itr_begin / itr_end / inc_begin / inc_end / inc_sep / infoline / expr / nl+ / any
itr_begin = ws inc_n... | 38.605263 | 141 | 0.605658 |
from .label import _Label as L
from parsimonious.grammar import Grammar, NodeVisitor
import re
rules = """
main = element+
element = itr_begin / itr_end / inc_begin / inc_end / inc_sep / infoline / expr / nl+ / any
itr_begin = ws inc_num ws "@" ws ~"Iteration +(\d+[^\d\s]){2}\d+" nl
itr_end = ws ~"=+" nl... | true | true |
1c0f55b41c47f4d3cc898b2f5aa42e3530e6013a | 864 | py | Python | experiments/within-sentence-experiments/PURE/shared/const.py | yyzhuang1991/MTE | b7ce7b427f849ccf7401433fe50fbc40e54f3d06 | [
"Apache-2.0"
] | null | null | null | experiments/within-sentence-experiments/PURE/shared/const.py | yyzhuang1991/MTE | b7ce7b427f849ccf7401433fe50fbc40e54f3d06 | [
"Apache-2.0"
] | null | null | null | experiments/within-sentence-experiments/PURE/shared/const.py | yyzhuang1991/MTE | b7ce7b427f849ccf7401433fe50fbc40e54f3d06 | [
"Apache-2.0"
] | null | null | null | task_ner_labels = {
'ace04': ['FAC', 'WEA', 'LOC', 'VEH', 'GPE', 'ORG', 'PER'],
'ace05': ['FAC', 'WEA', 'LOC', 'VEH', 'GPE', 'ORG', 'PER'],
'scierc': ['Method', 'OtherScientificTerm', 'Task', 'Generic', 'Material', 'Metric'],
# "mars": ["Target", "Component"],
"mars": ["Target", "Property"]
}
... | 32 | 108 | 0.541667 | task_ner_labels = {
'ace04': ['FAC', 'WEA', 'LOC', 'VEH', 'GPE', 'ORG', 'PER'],
'ace05': ['FAC', 'WEA', 'LOC', 'VEH', 'GPE', 'ORG', 'PER'],
'scierc': ['Method', 'OtherScientificTerm', 'Task', 'Generic', 'Material', 'Metric'],
"mars": ["Target", "Property"]
}
task_rel_labels = {
'ace04': [... | true | true |
1c0f55d14004ed3675dc1581fdf0e23bc922ef19 | 56,670 | py | Python | venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_list_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | 2 | 2020-09-30T00:11:09.000Z | 2021-10-04T13:00:38.000Z | venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_list_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_list_ops.py | databill86/HyperFoods | 9267937c8c70fd84017c0f153c241d2686a356dd | [
"MIT"
] | null | null | null | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: list_ops.cc
"""
import collections
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as... | 40.392017 | 146 | 0.721175 |
import collections
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _core
from tensorflow.python.eager import execute as _execute
from tensorflow.python.framework import dtypes as _dtypes
from ten... | true | true |
1c0f57435013cad94e75ba0222897a737d8d77ad | 315 | py | Python | zencad/examples/1.GeomPrim/3.prim1d/bezier.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/1.GeomPrim/3.prim1d/bezier.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/1.GeomPrim/3.prim1d/bezier.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
ZenCad API example: bezier.py
"""
from zencad import *
pnts = points([(0, 0, 0), (0, 10, 0), (10, 10)])
m0 = bezier(pnts)
m1 = bezier(pnts, weights=[1,2,1])
m2 = bezier(pnts, weights=[1,3,1])
disp(m0, color=(1,0,0))
disp(m1, color=(0,1,0))
disp(m2, color=(0,0,1))
disp(pnts)
show()
| 15 | 48 | 0.593651 |
from zencad import *
pnts = points([(0, 0, 0), (0, 10, 0), (10, 10)])
m0 = bezier(pnts)
m1 = bezier(pnts, weights=[1,2,1])
m2 = bezier(pnts, weights=[1,3,1])
disp(m0, color=(1,0,0))
disp(m1, color=(0,1,0))
disp(m2, color=(0,0,1))
disp(pnts)
show()
| true | true |
1c0f58ab7ea38d2728f103e87541887c9a312473 | 1,155 | py | Python | RFEM/BasicObjects/opening.py | DavidNaizheZhou/RFEM_Python_Client | a5f7790b67de3423907ce10c0aa513c0a1aca47b | [
"MIT"
] | null | null | null | RFEM/BasicObjects/opening.py | DavidNaizheZhou/RFEM_Python_Client | a5f7790b67de3423907ce10c0aa513c0a1aca47b | [
"MIT"
] | null | null | null | RFEM/BasicObjects/opening.py | DavidNaizheZhou/RFEM_Python_Client | a5f7790b67de3423907ce10c0aa513c0a1aca47b | [
"MIT"
] | null | null | null | from RFEM.initModel import Model, clearAtributes, ConvertToDlString
class Opening():
def __init__(self,
no: int = 1,
lines_no: str = '1 2 3 4',
comment: str = '',
params: dict = {}):
'''
Args:
no (int): Open... | 29.615385 | 71 | 0.55671 | from RFEM.initModel import Model, clearAtributes, ConvertToDlString
class Opening():
def __init__(self,
no: int = 1,
lines_no: str = '1 2 3 4',
comment: str = '',
params: dict = {}):
clientObject = Model.clientModel.fac... | true | true |
1c0f5ac4c6e5c30dfdeebdc8afdf78b766526ced | 130 | py | Python | pygsm/utilities/__init__.py | espottesmith/pyGSM | 5bf263f9ef6cbee3ec16355c5eb1839446e704e7 | [
"MIT"
] | null | null | null | pygsm/utilities/__init__.py | espottesmith/pyGSM | 5bf263f9ef6cbee3ec16355c5eb1839446e704e7 | [
"MIT"
] | null | null | null | pygsm/utilities/__init__.py | espottesmith/pyGSM | 5bf263f9ef6cbee3ec16355c5eb1839446e704e7 | [
"MIT"
] | null | null | null | __all__ = ['block_matrix','elements','manage_xyz','math_utils','nifty','options','units']
from .block_matrix import block_matrix
| 32.5 | 89 | 0.753846 | __all__ = ['block_matrix','elements','manage_xyz','math_utils','nifty','options','units']
from .block_matrix import block_matrix
| true | true |
1c0f5af76a24a8f0d7804a167af40714e07e87e9 | 8,351 | py | Python | demos/node-classification/hinsage/yelp-example.py | xugangwu95/stellargraph | f26f7733235573f5def19da3329fc1d92fdd71ee | [
"Apache-2.0"
] | 1 | 2021-09-24T09:38:01.000Z | 2021-09-24T09:38:01.000Z | demos/node-classification/hinsage/yelp-example.py | kjun9/stellargraph | 512e60a8f572a4bb432b0397a2b452251e167d8f | [
"Apache-2.0"
] | null | null | null | demos/node-classification/hinsage/yelp-example.py | kjun9/stellargraph | 512e60a8f572a4bb432b0397a2b452251e167d8f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Data61, CSIRO
#
# 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.394737 | 88 | 0.668662 |
import os
import argparse
import numpy as np
import pandas as pd
import networkx as nx
from tensorflow import keras
from tensorflow.keras import optimizers, layers, metrics
import tensorflow.keras.backend as K
from stellargraph.core import StellarGraph
from stellargraph.layer import HinSAGE
from stellargraph.mapper i... | true | true |
1c0f5b1ac93f2add170ec633e481a245ce5284f2 | 1,770 | py | Python | chapter14/search_mindrecord.py | mindspore-ai/book | d25e0f3948e882054dee68403bebd052e097e976 | [
"Apache-2.0",
"CC-BY-4.0"
] | 165 | 2020-03-28T07:05:18.000Z | 2021-08-05T01:04:42.000Z | chapter14/search_mindrecord.py | mindspore-ai/book | d25e0f3948e882054dee68403bebd052e097e976 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | chapter14/search_mindrecord.py | mindspore-ai/book | d25e0f3948e882054dee68403bebd052e097e976 | [
"Apache-2.0",
"CC-BY-4.0"
] | 5 | 2020-06-05T02:52:00.000Z | 2020-10-26T06:29:00.000Z | # Copyright 2019 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... | 32.777778 | 78 | 0.677401 |
import os
import uuid
from mindspore.mindrecord import MindPage, SUCCESS
from write_mindrecord import write_mindrecord_tutorial
MINDRECORD_FILE_NAME = "./imagenet.mindrecord"
def search_mindrecord_tutorial():
reader = MindPage(MINDRECORD_FILE_NAME)
fields = reader.get_category_fields()
assert fields == ... | true | true |
1c0f5b731677b4d5a6f47cd01217c5f6edf4e033 | 747 | py | Python | curriculum/migrations/0003_auto_20200926_1141.py | Akbarshokh/Schook_LMSS | 1502160f008cce4a2d06fabb7934f0cfefc4df3b | [
"MIT"
] | null | null | null | curriculum/migrations/0003_auto_20200926_1141.py | Akbarshokh/Schook_LMSS | 1502160f008cce4a2d06fabb7934f0cfefc4df3b | [
"MIT"
] | null | null | null | curriculum/migrations/0003_auto_20200926_1141.py | Akbarshokh/Schook_LMSS | 1502160f008cce4a2d06fabb7934f0cfefc4df3b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-26 06:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('curriculum', '0002_auto_20200926_1137'),
]
operations = [
migrations.AddField(
model_name='less... | 28.730769 | 118 | 0.630522 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('curriculum', '0002_auto_20200926_1137'),
]
operations = [
migrations.AddField(
model_name='lesson',
name='Standard',
fi... | true | true |
1c0f5ba51707f293a2fbbd40b4e7d6c6a5838c3b | 1,728 | py | Python | LottoCSVGraph.py | TuxStory/LCsvGraph | 61abca24692a2230597a3736c677322adb262e74 | [
"MIT"
] | null | null | null | LottoCSVGraph.py | TuxStory/LCsvGraph | 61abca24692a2230597a3736c677322adb262e74 | [
"MIT"
] | null | null | null | LottoCSVGraph.py | TuxStory/LCsvGraph | 61abca24692a2230597a3736c677322adb262e74 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import csv, statistics
def DataList():
path ="./LottoGameData.csv"
file = open(path,newline='')
reader = csv.reader(file)
header = next(reader) #first line is the reader
data = []
for row in reader:
# row = [date, n1, n2, n3, n4, n5, n... | 28.327869 | 101 | 0.618634 | import matplotlib.pyplot as plt
import numpy as np
import csv, statistics
def DataList():
path ="./LottoGameData.csv"
file = open(path,newline='')
reader = csv.reader(file)
header = next(reader) data = []
for row in reader:
num = list(map(int,row[1:8])) data.append(num)
... | true | true |
1c0f5babbb302e42a236f8f5d91a19d2b9097dbd | 1,820 | py | Python | utils/utils.py | yigitozgumus/IACV_Project | 0e012139a33c76ca88505c28270f1250181ec701 | [
"MIT"
] | null | null | null | utils/utils.py | yigitozgumus/IACV_Project | 0e012139a33c76ca88505c28270f1250181ec701 | [
"MIT"
] | null | null | null | utils/utils.py | yigitozgumus/IACV_Project | 0e012139a33c76ca88505c28270f1250181ec701 | [
"MIT"
] | null | null | null | import os
from contextlib import contextmanager
import json
import argparse
from argparse import Namespace
def get_config_from_json(json_file):
"""
Get the config from a json file
:param json_file:
:return: config(namespace) or config(dictionary)
"""
# parse the configurations from the config ... | 25.633803 | 89 | 0.658242 | import os
from contextlib import contextmanager
import json
import argparse
from argparse import Namespace
def get_config_from_json(json_file):
with open(json_file, 'r') as config_file:
config_dict = json.load(config_file)
config = Namespace(**config_dict)
return config, config_dict
def... | true | true |
1c0f5c01309d6bde62584e2438726b31633f9f1f | 1,341 | py | Python | jupyter_book/__init__.py | pgadige/jupyter-book | 4894ad0878183606477ff23f8978275277ecf3c5 | [
"BSD-3-Clause"
] | null | null | null | jupyter_book/__init__.py | pgadige/jupyter-book | 4894ad0878183606477ff23f8978275277ecf3c5 | [
"BSD-3-Clause"
] | null | null | null | jupyter_book/__init__.py | pgadige/jupyter-book | 4894ad0878183606477ff23f8978275277ecf3c5 | [
"BSD-3-Clause"
] | null | null | null | """Build a book with Jupyter Notebooks and Sphinx."""
from pathlib import Path
from .toc import update_indexname, add_toctree
from .directive.toc import TableofContents
__version__ = "0.7.0b5dev0"
def add_static_files(app, config):
"""Search the static files paths and initialize any CSS of JS files."""
sta... | 29.8 | 75 | 0.691275 | from pathlib import Path
from .toc import update_indexname, add_toctree
from .directive.toc import TableofContents
__version__ = "0.7.0b5dev0"
def add_static_files(app, config):
static_paths = config.html_static_path
for path in static_paths:
path = Path(app.confdir).joinpath(path)
for path... | true | true |
1c0f5c9868b405569f66d5bbfc8c94c08a0cdbb1 | 1,856 | py | Python | src/generators/gen_german.py | russelldavis/alfred-pwgen | ce707353d7dfbb947bf8d86111c6e7fd7e11abe9 | [
"MIT"
] | 262 | 2015-07-30T14:35:10.000Z | 2022-03-28T10:25:46.000Z | alfred/Alfred.alfredpreferences/workflows/user.workflow.DD46FE0F-0B3B-477A-AE93-C23F48313BBB/generators/gen_german.py | karamfil/saphe | f1c56dcf11613808e07f462d50f20881aef7fbdc | [
"MIT"
] | 10 | 2016-02-24T00:23:05.000Z | 2022-03-30T19:16:10.000Z | alfred/Alfred.alfredpreferences/workflows/user.workflow.DD46FE0F-0B3B-477A-AE93-C23F48313BBB/generators/gen_german.py | karamfil/saphe | f1c56dcf11613808e07f462d50f20881aef7fbdc | [
"MIT"
] | 22 | 2016-02-22T20:03:30.000Z | 2022-03-31T06:36:29.000Z | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2015 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2015-07-27
#
"""
Password genrators based on the German alphabet.
These are variations on the default generators using an alphabet
extended with Ge... | 21.835294 | 75 | 0.705819 |
from __future__ import print_function, unicode_literals, absolute_import
from .gen_basic import AsciiGenerator, AlphanumGenerator
from .gen_pronounceable_markov import PronounceableMarkovGenerator
german_chars = 'ÄäÖöÜüß'
class GermanGenerator(AsciiGenerator):
@property
def id(self):
return 'ger... | true | true |
1c0f5d4a13964fc01d48a4fb4898a8240f37ab5d | 6,401 | py | Python | networking_odl/common/lightweight_testing.py | gokarslan/networking-odl2 | 6a6967832b2c02dfcff6a9f0ab6e36472b849ce8 | [
"Apache-2.0"
] | null | null | null | networking_odl/common/lightweight_testing.py | gokarslan/networking-odl2 | 6a6967832b2c02dfcff6a9f0ab6e36472b849ce8 | [
"Apache-2.0"
] | null | null | null | networking_odl/common/lightweight_testing.py | gokarslan/networking-odl2 | 6a6967832b2c02dfcff6a9f0ab6e36472b849ce8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Intel Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 35.759777 | 78 | 0.635682 |
from copy import deepcopy
import requests
import six
from oslo_log import log as logging
from oslo_serialization import jsonutils
from networking_odl._i18n import _
from networking_odl.common import client
from networking_odl.common import constants as odl_const
LOG = logging.getLogger(__name__)
OK = requests.co... | true | true |
1c0f5eba90addc4bd3b375da4bce4d1512180d8e | 1,533 | py | Python | asreview/balance_strategies/__init__.py | J535D165/asreview | eda3c52a595d739093c3cd6cd37d41eeed6dd15c | [
"Apache-2.0"
] | null | null | null | asreview/balance_strategies/__init__.py | J535D165/asreview | eda3c52a595d739093c3cd6cd37d41eeed6dd15c | [
"Apache-2.0"
] | null | null | null | asreview/balance_strategies/__init__.py | J535D165/asreview | eda3c52a595d739093c3cd6cd37d41eeed6dd15c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The ASReview 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 applicabl... | 46.454545 | 74 | 0.819309 |
from asreview.balance_strategies.simple import SimpleBalance
from asreview.balance_strategies.double import DoubleBalance
from asreview.balance_strategies.triple import TripleBalance
from asreview.balance_strategies.undersample import UndersampleBalance
from asreview.balance_strategies.utils import get_balance_model
f... | true | true |
1c0f610663ebbce8aa4efc47a82f04d7e952f984 | 839 | py | Python | app/models/tbl_video_game_sales.py | ybqdren/BygjRace-DataShowChart | eb903aaf0dd8682e1c12eb182e9f0b7f4eef2daf | [
"Apache-2.0"
] | null | null | null | app/models/tbl_video_game_sales.py | ybqdren/BygjRace-DataShowChart | eb903aaf0dd8682e1c12eb182e9f0b7f4eef2daf | [
"Apache-2.0"
] | null | null | null | app/models/tbl_video_game_sales.py | ybqdren/BygjRace-DataShowChart | eb903aaf0dd8682e1c12eb182e9f0b7f4eef2daf | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
#@Time : 2020/9/22 16:07
#@Author: 赵雯
#@File : tbl_video_game_sales.py
from app.extensions import db
class Tbl_Video_Game_Sales(db.Model):
__tablename__ = 't_video_game_sales'
Rank = db.Column(db.String(255),primary_key=True) #销售排名
Name = db.Column(db.String(255)) #游戏名称
Pl... | 39.952381 | 66 | 0.671037 |
from app.extensions import db
class Tbl_Video_Game_Sales(db.Model):
__tablename__ = 't_video_game_sales'
Rank = db.Column(db.String(255),primary_key=True) Name = db.Column(db.String(255)) Platform = db.Column(db.String(255)) Year = db.Column(db.Integer) Genre = db.Column(db.String(... | true | true |
1c0f6108a8bdf5aadeb273fe8e4c41f17a3d46ab | 919 | py | Python | backend/microservices/audio-generator/core/entities/__init__.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | 3 | 2021-04-26T00:17:14.000Z | 2021-07-04T15:30:09.000Z | backend/microservices/audio-generator/core/entities/__init__.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | null | null | null | backend/microservices/audio-generator/core/entities/__init__.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | null | null | null | import sys
from os import path
from .make_audio_order import build_make_audio_order
from .audio_order import *
from .exception import *
from .book_parsing import *
sys.path.append(path.realpath(path.join(path.dirname(__file__), '../..')))
def title_validator(title: str):
from config import BOOK_TITLE_... | 24.837838 | 75 | 0.732318 | import sys
from os import path
from .make_audio_order import build_make_audio_order
from .audio_order import *
from .exception import *
from .book_parsing import *
sys.path.append(path.realpath(path.join(path.dirname(__file__), '../..')))
def title_validator(title: str):
from config import BOOK_TITLE_... | true | true |
1c0f61452a378d1294892ebbc14499e7db8e8765 | 2,066 | py | Python | test/test_archive_document.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | 2 | 2022-02-17T08:33:17.000Z | 2022-03-22T09:27:00.000Z | test/test_archive_document.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | test/test_archive_document.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | """
Fatture in Cloud API v2 - API Reference
Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. # noq... | 38.981132 | 278 | 0.6515 |
import unittest
import json
import datetime
from fattureincloud_python_sdk.model.archive_document import ArchiveDocument
from functions import json_serial
from functions import create_from_json
class TestArchiveDocument(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | true | true |
1c0f6172a0d481f4ca6e75563b2ada4d4c420a4d | 30,901 | py | Python | Jumpscale/builder/tools/BuilderTools.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 2 | 2019-05-09T07:21:25.000Z | 2019-08-05T06:37:53.000Z | Jumpscale/builder/tools/BuilderTools.py | threefoldtech/JumpscaleX | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 664 | 2018-12-19T12:43:44.000Z | 2019-08-23T04:24:42.000Z | Jumpscale/builder/tools/BuilderTools.py | threefoldtech/jumpscale10 | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 7 | 2019-05-03T07:14:37.000Z | 2019-08-05T12:36:52.000Z | from __future__ import with_statement
import os
from Jumpscale import j
from .BuilderToolsLib import *
# import pygments.lexers
# from pygments.formatters import get_formatter_by_name
class BuilderTools(j.builders.system._BaseClass):
__jslocation__ = "j.builders.tools"
def _init(self):
self._cd =... | 35.518391 | 176 | 0.541989 | from __future__ import with_statement
import os
from Jumpscale import j
from .BuilderToolsLib import *
class BuilderTools(j.builders.system._BaseClass):
__jslocation__ = "j.builders.tools"
def _init(self):
self._cd = "/tmp"
def _replace(self, txt):
return j.core.tools.text_replace(tx... | true | true |
1c0f626e6348e1d3e2034b3f74f179789c691bd6 | 9,583 | py | Python | dxlclient/test/test_callback_manager.py | freedai/opendxl-client-python | b6a5b216b4b9ba815a1b03e07755db563880881f | [
"Apache-2.0"
] | 110 | 2016-11-03T17:49:24.000Z | 2021-03-25T20:53:42.000Z | dxlclient/test/test_callback_manager.py | freedai/opendxl-client-python | b6a5b216b4b9ba815a1b03e07755db563880881f | [
"Apache-2.0"
] | 23 | 2016-11-04T17:08:13.000Z | 2021-12-03T19:30:53.000Z | dxlclient/test/test_callback_manager.py | freedai/opendxl-client-python | b6a5b216b4b9ba815a1b03e07755db563880881f | [
"Apache-2.0"
] | 63 | 2016-11-03T17:49:38.000Z | 2022-03-15T12:02:49.000Z | # -*- coding: utf-8 -*-
################################################################################
# Copyright (c) 2018 McAfee LLC - All Rights Reserved.
################################################################################
"""
Test cases for the CallbackManager class
"""
# Run with python -m unittes... | 47.676617 | 80 | 0.708964 |
from __future__ import absolute_import
import unittest
from dxlclient import callbacks
import dxlclient._callback_manager as callback_manager
class MockRequestCallback(callbacks.RequestCallback):
def on_request(self, request):
pass
class MockResponseCallback(callbacks.ResponseCallback):
def on_... | true | true |
1c0f63e409ae82bfb068084bfae322818a5e02b6 | 2,739 | py | Python | lib/surface/compute/security_policies/rules/create.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/security_policies/rules/create.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/compute/security_policies/rules/create.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... | 35.115385 | 97 | 0.732749 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.api_lib.compute.security_policies import client
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.compute.s... | true | true |
1c0f64032287c592e6a6333136d12d6bda4dc283 | 148 | py | Python | tests/apis/api1/urls.py | xuxiaowei-com-cn/Django-demo | 110d15cd615854bb6732d26ddd85f45afe7d7d0a | [
"MIT"
] | null | null | null | tests/apis/api1/urls.py | xuxiaowei-com-cn/Django-demo | 110d15cd615854bb6732d26ddd85f45afe7d7d0a | [
"MIT"
] | null | null | null | tests/apis/api1/urls.py | xuxiaowei-com-cn/Django-demo | 110d15cd615854bb6732d26ddd85f45afe7d7d0a | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'tests/apis/api1'
urlpatterns = [
# 主页
path('', views.index, name='index')
]
| 13.454545 | 39 | 0.648649 | from django.urls import path
from . import views
app_name = 'tests/apis/api1'
urlpatterns = [
path('', views.index, name='index')
]
| true | true |
1c0f640ae743d3d73b0bccff540dc9b49512cd74 | 8,617 | py | Python | railrl/torch/pytorch_util.py | Haichao-Zhang/leap | 4d75961ff2ff203d4412633cbeb12889de3c79b6 | [
"MIT"
] | 36 | 2019-11-09T05:50:33.000Z | 2022-03-24T08:37:08.000Z | railrl/torch/pytorch_util.py | Haichao-Zhang/leap | 4d75961ff2ff203d4412633cbeb12889de3c79b6 | [
"MIT"
] | 6 | 2019-12-20T05:42:16.000Z | 2020-11-21T06:57:28.000Z | railrl/torch/pytorch_util.py | Haichao-Zhang/leap | 4d75961ff2ff203d4412633cbeb12889de3c79b6 | [
"MIT"
] | 11 | 2019-11-22T21:36:19.000Z | 2021-11-10T18:51:43.000Z | import torch
import numpy as np
from torch.autograd import Variable as TorchVariable
from torch.nn import functional as F
def soft_update_from_to(source, target, tau):
for target_param, param in zip(target.parameters(), source.parameters()):
target_param.data.copy_(
target_param.data * (1.0 - ... | 28.819398 | 96 | 0.646397 | import torch
import numpy as np
from torch.autograd import Variable as TorchVariable
from torch.nn import functional as F
def soft_update_from_to(source, target, tau):
for target_param, param in zip(target.parameters(), source.parameters()):
target_param.data.copy_(
target_param.data * (1.0 - ... | true | true |
1c0f6498e990f63f3f1cf9972171a15b4e7eb802 | 304 | py | Python | Tensorflow_InAction_Google/code/004/tensorflow/001.clip_by_value.py | lsieun/learn-AI | 0a164bc2e6317de3aa03c747c0e6f15d93e7f49a | [
"Apache-2.0"
] | 1 | 2019-03-27T23:22:44.000Z | 2019-03-27T23:22:44.000Z | Tensorflow_InAction_Google/code/004/tensorflow/001.clip_by_value.py | lsieun/learn-AI | 0a164bc2e6317de3aa03c747c0e6f15d93e7f49a | [
"Apache-2.0"
] | null | null | null | Tensorflow_InAction_Google/code/004/tensorflow/001.clip_by_value.py | lsieun/learn-AI | 0a164bc2e6317de3aa03c747c0e6f15d93e7f49a | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
v = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], dtype=tf.float32,shape=(2,3),name="v")
clip_op = tf.clip_by_value(v, clip_value_min=2.5, clip_value_max=4.5, name="clip_op")
print("clip_op = ", clip_op)
with tf.Session() as sess:
result = clip_op.eval()
print(result) | 33.777778 | 90 | 0.661184 | import tensorflow as tf
v = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], dtype=tf.float32,shape=(2,3),name="v")
clip_op = tf.clip_by_value(v, clip_value_min=2.5, clip_value_max=4.5, name="clip_op")
print("clip_op = ", clip_op)
with tf.Session() as sess:
result = clip_op.eval()
print(result) | true | true |
1c0f652bd326e2de29b63e1b4360717daccb052c | 190 | py | Python | apps/accounts/models.py | sakdag/f1-blog | b59cd85aeca388566a9932bc5c1bc681aac1645a | [
"MIT"
] | null | null | null | apps/accounts/models.py | sakdag/f1-blog | b59cd85aeca388566a9932bc5c1bc681aac1645a | [
"MIT"
] | null | null | null | apps/accounts/models.py | sakdag/f1-blog | b59cd85aeca388566a9932bc5c1bc681aac1645a | [
"MIT"
] | null | null | null | from django.contrib import auth
from django.contrib.auth import models
class User(models.User, models.PermissionsMixin):
def __str__(self):
return '@{}'.format(self.username)
| 21.111111 | 49 | 0.731579 | from django.contrib import auth
from django.contrib.auth import models
class User(models.User, models.PermissionsMixin):
def __str__(self):
return '@{}'.format(self.username)
| true | true |
1c0f665d0367f02f9b4162526d138b730f871540 | 2,908 | py | Python | util/stdout_redirector.py | coallaoh/ResearchTools | 7239640c5de0285a5c5dcc5d1d0d5aaf554b3e93 | [
"MIT"
] | 4 | 2017-11-03T19:05:51.000Z | 2020-11-16T08:31:17.000Z | util/stdout_redirector.py | coallaoh/ResearchTools | 7239640c5de0285a5c5dcc5d1d0d5aaf554b3e93 | [
"MIT"
] | null | null | null | util/stdout_redirector.py | coallaoh/ResearchTools | 7239640c5de0285a5c5dcc5d1d0d5aaf554b3e93 | [
"MIT"
] | 1 | 2018-07-19T07:09:27.000Z | 2018-07-19T07:09:27.000Z |
# http://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/
from contextlib import contextmanager
import ctypes
import io
import os, sys
import tempfile
libc = ctypes.CDLL(None)
c_stdout = ctypes.c_void_p.in_dll(libc, 'stdout')
c_stderr = ctypes.c_void_p.in_dll(libc, 'stderr')
@contextmanager
de... | 35.901235 | 78 | 0.679161 |
from contextlib import contextmanager
import ctypes
import io
import os, sys
import tempfile
libc = ctypes.CDLL(None)
c_stdout = ctypes.c_void_p.in_dll(libc, 'stdout')
c_stderr = ctypes.c_void_p.in_dll(libc, 'stderr')
@contextmanager
def stdout_redirector(stream):
original_stdout_fd = sys.stdout.fileno()
... | true | true |
1c0f666b41096555fbaa4876ad4b1916ee047c91 | 379 | py | Python | src/subtitles_job_schedule/__init__.py | hguerra/subtitles-job-schedule | 0a3ffb0be29b9923c71f8401f03f9f1d42f5574f | [
"MIT"
] | null | null | null | src/subtitles_job_schedule/__init__.py | hguerra/subtitles-job-schedule | 0a3ffb0be29b9923c71f8401f03f9f1d42f5574f | [
"MIT"
] | 1 | 2021-06-02T00:58:51.000Z | 2021-06-02T00:58:51.000Z | src/subtitles_job_schedule/__init__.py | hguerra/subtitles-job-schedule | 0a3ffb0be29b9923c71f8401f03f9f1d42f5574f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pkg_resources import get_distribution, DistributionNotFound
try:
# Change here if project is renamed and does not equal the package name
dist_name = 'subtitles-job-schedule'
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknow... | 31.583333 | 75 | 0.76781 | from pkg_resources import get_distribution, DistributionNotFound
try:
dist_name = 'subtitles-job-schedule'
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknown'
finally:
del get_distribution, DistributionNotFound
| true | true |
1c0f66c853a487c6f1f472712f7ba4d2b6fa1969 | 2,118 | py | Python | scripts/cogapp/whiteutils.py | ptrahrens/ReproBLAS | ae50ec6bcb4426af8f08f065c148227b8dcfe763 | [
"BSD-3-Clause"
] | 6 | 2018-10-02T18:51:26.000Z | 2021-03-13T02:23:24.000Z | scripts/cogapp/whiteutils.py | ptrahrens/ReproBLAS | ae50ec6bcb4426af8f08f065c148227b8dcfe763 | [
"BSD-3-Clause"
] | 6 | 2017-08-01T22:27:28.000Z | 2019-12-20T08:34:48.000Z | scripts/cogapp/whiteutils.py | ptrahrens/ReproBLAS | ae50ec6bcb4426af8f08f065c148227b8dcfe763 | [
"BSD-3-Clause"
] | 8 | 2017-07-01T22:19:09.000Z | 2022-02-01T21:02:31.000Z | """ Indentation utilities for Cog.
http://nedbatchelder.com/code/cog
Copyright 2004-2015, Ned Batchelder.
"""
from __future__ import absolute_import
import re
from .backward import string_types, bytes_types, to_bytes, b
def whitePrefix(strings):
""" Determine the whitespace prefix common to all non-blank... | 29.416667 | 69 | 0.593012 |
from __future__ import absolute_import
import re
from .backward import string_types, bytes_types, to_bytes, b
def whitePrefix(strings):
strings = [s for s in strings if s.strip() != '']
if not strings: return ''
pat = r'\s*'
if isinstance(strings[0], bytes_types):
pat = to_bytes(... | true | true |
1c0f66d6026122bd7e0a8c3c97137f0dbc34dd8f | 557 | py | Python | archives/models.py | fromdanut/syndicat-riviere | 0fd099524a2a79d0932dbf8b87f8232d470308ad | [
"MIT"
] | null | null | null | archives/models.py | fromdanut/syndicat-riviere | 0fd099524a2a79d0932dbf8b87f8232d470308ad | [
"MIT"
] | 1 | 2017-09-19T09:34:53.000Z | 2017-09-19T09:34:53.000Z | archives/models.py | fromdanut/syndicat-riviere | 0fd099524a2a79d0932dbf8b87f8232d470308ad | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Document(models.Model):
titre = models.CharField(max_length=100)
document = models.FileField(upload_to="archives/")
date = models.DateTimeField(verbose_name="Date de parution")... | 17.967742 | 64 | 0.698384 |
from __future__ import unicode_literals
from django.db import models
class Document(models.Model):
titre = models.CharField(max_length=100)
document = models.FileField(upload_to="archives/")
date = models.DateTimeField(verbose_name="Date de parution")
categorie = models.ForeignKey('Categorie... | true | true |
1c0f66ee675381c3840b93ffa2630554ab3548f2 | 277 | py | Python | src/medius/mediuspackets/banplayer.py | Metroynome/robo | 78c389decce98d0d1e4e4e02ccbfcba7b465209c | [
"MIT"
] | 8 | 2021-07-14T16:55:04.000Z | 2022-03-07T22:03:03.000Z | src/medius/mediuspackets/banplayer.py | Metroynome/robo | 78c389decce98d0d1e4e4e02ccbfcba7b465209c | [
"MIT"
] | 22 | 2021-07-13T02:17:00.000Z | 2022-02-13T03:26:52.000Z | src/medius/mediuspackets/banplayer.py | Metroynome/robo | 78c389decce98d0d1e4e4e02ccbfcba7b465209c | [
"MIT"
] | 5 | 2021-07-30T05:49:09.000Z | 2022-02-14T18:02:07.000Z |
from utils import utils
class BanPlayerSerializer:
data_dict = [
{'name': 'mediusid', 'n_bytes': 2, 'cast': None}
]
class BanPlayerHandler:
def process(self, serialized, monolith, con):
raise Exception('Unimplemented Handler: BanPlayerHandler')
| 21.307692 | 66 | 0.67509 |
from utils import utils
class BanPlayerSerializer:
data_dict = [
{'name': 'mediusid', 'n_bytes': 2, 'cast': None}
]
class BanPlayerHandler:
def process(self, serialized, monolith, con):
raise Exception('Unimplemented Handler: BanPlayerHandler')
| true | true |
1c0f670687b97e0de4f14488670bd401f249cd2c | 1,304 | py | Python | key_generator/source/algorithm/asymmetric/rsa_feature/impl/rsa_algorith_impl.py | thiagoolsilva/cryptography-cli | 3361556fc155d1a1fccd21aa29d1394cedba8979 | [
"Apache-2.0"
] | 1 | 2020-12-29T18:44:45.000Z | 2020-12-29T18:44:45.000Z | key_generator/source/algorithm/asymmetric/rsa_feature/impl/rsa_algorith_impl.py | thiagoolsilva/cryptography-cli | 3361556fc155d1a1fccd21aa29d1394cedba8979 | [
"Apache-2.0"
] | 1 | 2020-12-29T18:40:56.000Z | 2020-12-30T16:12:25.000Z | key_generator/source/algorithm/asymmetric/rsa_feature/impl/rsa_algorith_impl.py | thiagoolsilva/cryptography-cli | 3361556fc155d1a1fccd21aa29d1394cedba8979 | [
"Apache-2.0"
] | 1 | 2022-02-28T14:53:52.000Z | 2022-02-28T14:53:52.000Z | # Copyright (c) 2020 Thiago Lopes da Silva
#
# 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... | 44.965517 | 100 | 0.803681 |
from algorithm.asymmetric.asymmetric_algorithm_contract import AsymmetricAlgorithmContract
from algorithm.asymmetric.rsa_feature.user_case.create_rsa_keys_use_case import CreateRsaKeyUserCase
from algorithm.asymmetric.supported_asymmetric_algorithm import SupportedAsymmetricAlgorithm
from shared.keys_entity import Key... | true | true |
1c0f67313283de145ceb3b79d826321b5b06143c | 2,608 | py | Python | logui.py | Mask0913/Driver_monitor | 49b65bb346bfa5082c71827f8f54beebeceb917a | [
"MIT"
] | null | null | null | logui.py | Mask0913/Driver_monitor | 49b65bb346bfa5082c71827f8f54beebeceb917a | [
"MIT"
] | null | null | null | logui.py | Mask0913/Driver_monitor | 49b65bb346bfa5082c71827f8f54beebeceb917a | [
"MIT"
] | 1 | 2022-02-20T16:37:33.000Z | 2022-02-20T16:37:33.000Z | import sys
import torch
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QFont, QIcon
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QDesktopWidget, QHBoxLayout, QFormLayout, \
QPushButton, QLineEdit, QMainWindow
class LoginForm(QMainWindow):
def __init__(self):
super().__init... | 29.636364 | 102 | 0.635736 | import sys
import torch
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QFont, QIcon
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QDesktopWidget, QHBoxLayout, QFormLayout, \
QPushButton, QLineEdit, QMainWindow
class LoginForm(QMainWindow):
def __init__(self):
super().__init... | true | true |
1c0f6743669a02e4a64f401923d57e532f08ebcf | 3,936 | py | Python | sdk/python/pulumi_azure_native/datashare/v20181101preview/list_share_subscription_synchronization_details.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/v20181101preview/list_share_subscription_synchronization_details.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/v20181101preview/list_share_subscription_synchronization_details.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 41.431579 | 204 | 0.660569 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'ListShareSubscriptionSynchronizationDetailsResult',
'AwaitableListShareSubscriptionSynchronizationDetailsResult',
'list_sha... | true | true |
1c0f67c2b590dc0b12f13903f2ddf2be4ef7abfb | 377 | py | Python | dkron/migrations/0002_job_retries.py | surface-security/django-dkron | e85810cfebfc51ad6143befebf758b000662494e | [
"MIT"
] | 1 | 2022-01-24T10:29:14.000Z | 2022-01-24T10:29:14.000Z | dkron/migrations/0002_job_retries.py | surface-security/django-dkron | e85810cfebfc51ad6143befebf758b000662494e | [
"MIT"
] | 6 | 2022-01-17T16:50:38.000Z | 2022-03-23T17:46:33.000Z | dkron/migrations/0002_job_retries.py | surface-security/django-dkron | e85810cfebfc51ad6143befebf758b000662494e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-09-29 12:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dkron', '0001_initial_20210729'),
]
operations = [
migrations.AddField(
model_name='job',
name='retries',
... | 19.842105 | 49 | 0.588859 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dkron', '0001_initial_20210729'),
]
operations = [
migrations.AddField(
model_name='job',
name='retries',
field=models.IntegerField(default=0),
... | true | true |
1c0f680577bed58a220b4ce4777d4cdf7c2f9495 | 6,894 | py | Python | miscpy/utils/sympyhelpers.py | dsavransky/miscpy | 254d8b6be58012b9318dad8b7215f3d6b958ddbb | [
"MIT"
] | 1 | 2021-03-12T15:51:31.000Z | 2021-03-12T15:51:31.000Z | miscpy/utils/sympyhelpers.py | dsavransky/miscpy | 254d8b6be58012b9318dad8b7215f3d6b958ddbb | [
"MIT"
] | null | null | null | miscpy/utils/sympyhelpers.py | dsavransky/miscpy | 254d8b6be58012b9318dad8b7215f3d6b958ddbb | [
"MIT"
] | 1 | 2016-05-02T13:23:46.000Z | 2016-05-02T13:23:46.000Z | '''
sympy helper functions
'''
import sympy
from sympy import *
th,ph,psi,thd,phd,psid,thdd,phdd,psidd = symbols('theta,phi,psi,thetadot,phidot,psidot,thetaddot,phiddot,psiddot',real=True)
w1,w2,w3 = symbols('omega_1,omega_2,omega_3',real=True)
t,g,m,h = symbols('t,g,m,h',real=True)
circmat = Matrix([eye(3)[2-j,:] fo... | 34.298507 | 124 | 0.646649 |
import sympy
from sympy import *
th,ph,psi,thd,phd,psid,thdd,phdd,psidd = symbols('theta,phi,psi,thetadot,phidot,psidot,thetaddot,phiddot,psiddot',real=True)
w1,w2,w3 = symbols('omega_1,omega_2,omega_3',real=True)
t,g,m,h = symbols('t,g,m,h',real=True)
circmat = Matrix([eye(3)[2-j,:] for j in range(3)]) polarframe = ... | true | true |
1c0f6865f1ae79f5ca5027021b4d14e9b05cd063 | 4,688 | py | Python | tarpn/util.py | rxt1077/tarpn-node-controller | ffbe1d78fbd1c10e891b3339b50002e5233e21ad | [
"MIT"
] | null | null | null | tarpn/util.py | rxt1077/tarpn-node-controller | ffbe1d78fbd1c10e891b3339b50002e5233e21ad | [
"MIT"
] | null | null | null | tarpn/util.py | rxt1077/tarpn-node-controller | ffbe1d78fbd1c10e891b3339b50002e5233e21ad | [
"MIT"
] | null | null | null | import asyncio
import datetime
import json
import math
import threading
import time
from typing import Callable, Iterator, Dict
class Timer:
def __init__(self, delay: float, cb: Callable[[], None]):
"""
A resettable and cancelable timer class
:param delay: Delay in milliseconds
:pa... | 25.478261 | 91 | 0.623933 | import asyncio
import datetime
import json
import math
import threading
import time
from typing import Callable, Iterator, Dict
class Timer:
def __init__(self, delay: float, cb: Callable[[], None]):
self.delay = delay
self._cb = cb
self._started = 0
self._timer = None
def __re... | true | true |
1c0f68d0b347f15148f6b9d3cc1dacc75b64bf1e | 918 | py | Python | integration_tests/nodejs_vision_test.py | HemangChothani/synthtool | fdd03c161003ab97657cc0218f25c82c89ddf4b6 | [
"Apache-2.0"
] | 53 | 2018-10-29T20:10:03.000Z | 2022-01-01T02:53:58.000Z | integration_tests/nodejs_vision_test.py | HemangChothani/synthtool | fdd03c161003ab97657cc0218f25c82c89ddf4b6 | [
"Apache-2.0"
] | 541 | 2018-09-25T02:30:52.000Z | 2022-03-30T21:45:08.000Z | integration_tests/nodejs_vision_test.py | HemangChothani/synthtool | fdd03c161003ab97657cc0218f25c82c89ddf4b6 | [
"Apache-2.0"
] | 61 | 2019-01-15T15:05:15.000Z | 2022-01-24T21:05:57.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.307692 | 82 | 0.755991 |
import integration_tests.util
def test():
git_log_path = integration_tests.util.generate(
"googleapis/nodejs-vision", "3c174187849eb75d1a35ae3b8df9bf5205d00662"
)
integration_tests.util.assert_git_logs_match(
git_log_path,
integration_tests.util.get_testdata_file_path("nodejs-visi... | true | true |
1c0f690660796bde3d69bda6bf0cfc87fc8a16f2 | 20,519 | py | Python | azure-devops/azext_devops/devops_sdk/v5_1/work_item_tracking_comments/models.py | doggy8088/azure-devops-cli-extension | 2f6b1a6ffbc49ae454df640a8bb00dac991d6514 | [
"MIT"
] | 326 | 2019-04-10T12:38:23.000Z | 2022-03-31T23:07:49.000Z | azure-devops/azext_devops/devops_sdk/v5_1/work_item_tracking_comments/models.py | doggy8088/azure-devops-cli-extension | 2f6b1a6ffbc49ae454df640a8bb00dac991d6514 | [
"MIT"
] | 562 | 2019-04-10T07:36:12.000Z | 2022-03-28T07:37:54.000Z | azure-devops/azext_devops/devops_sdk/v5_1/work_item_tracking_comments/models.py | doggy8088/azure-devops-cli-extension | 2f6b1a6ffbc49ae454df640a8bb00dac991d6514 | [
"MIT"
] | 166 | 2019-04-10T07:59:40.000Z | 2022-03-16T14:17:13.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | 47.278802 | 270 | 0.681027 |
from msrest.serialization import Model
class GraphSubjectBase(Model):
"""GraphSubjectBase.
:param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
:typ... | false | true |
1c0f6b12dae138f4a4e5baf4de43eca9588e60e8 | 8,850 | py | Python | lib/streamlit/elements/form.py | arraydude/streamlit-1 | ab7c339623b457c71e3b77e3162c86962ac167d0 | [
"Apache-2.0"
] | null | null | null | lib/streamlit/elements/form.py | arraydude/streamlit-1 | ab7c339623b457c71e3b77e3162c86962ac167d0 | [
"Apache-2.0"
] | 52 | 2021-10-04T21:52:48.000Z | 2021-12-29T02:18:44.000Z | lib/streamlit/elements/form.py | arraydude/streamlit-1 | ab7c339623b457c71e3b77e3162c86962ac167d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Streamlit 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 wr... | 34.705882 | 88 | 0.631412 |
import textwrap
from typing import cast, Optional, NamedTuple
import streamlit
from streamlit.errors import StreamlitAPIException
from streamlit.proto import Block_pb2
from streamlit.script_run_context import get_script_run_ctx
class FormData(NamedTuple):
form_id: str
def _current_form(
this_dg: "str... | true | true |
1c0f6c134ae4e6fbc3e6286291af34270cb81183 | 5,252 | py | Python | dialog_main.py | Ohara124c41/Nao-Robot | 83295bc3f51eb2258c6d5b567a7dacd83c3e3287 | [
"MIT"
] | 9 | 2019-11-01T03:53:30.000Z | 2021-12-30T02:52:37.000Z | dialog_main.py | Ohara124c41/Nao-Robot | 83295bc3f51eb2258c6d5b567a7dacd83c3e3287 | [
"MIT"
] | null | null | null | dialog_main.py | Ohara124c41/Nao-Robot | 83295bc3f51eb2258c6d5b567a7dacd83c3e3287 | [
"MIT"
] | 3 | 2019-06-19T13:04:21.000Z | 2020-02-27T14:20:45.000Z | import naoqi
from naoqi import ALProxy
import nao_nocv_2_0 as nao
import time
import math
#asr.unsubscribe("MyModule") # sometimes needed when robot crashed unexpectedly
robotIP='192.168.0.115'
nao.InitProxy(robotIP)
nao.InitPose()
asr = ALProxy("ALSpeechRecognition", IP, 9559)
def introduction()
m... | 30.894118 | 80 | 0.509901 | import naoqi
from naoqi import ALProxy
import nao_nocv_2_0 as nao
import time
import math
robotIP='192.168.0.115'
nao.InitProxy(robotIP)
nao.InitPose()
asr = ALProxy("ALSpeechRecognition", IP, 9559)
def introduction()
motion.basicWave()
nao.Say("Hello, my name is Felix")
time.sleep(2)
... | false | true |
1c0f6c38fb93a76eda9b18eaa60a4858b0f4cba7 | 1,542 | py | Python | tests/blessclient/vault_ca_test.py | mwpeterson/python-blessclient | ae9ab72fe2c62d311e22a9c863a662812af7ac09 | [
"Apache-2.0"
] | 115 | 2017-02-12T23:08:35.000Z | 2020-08-30T10:18:05.000Z | tests/blessclient/vault_ca_test.py | mwpeterson/python-blessclient | ae9ab72fe2c62d311e22a9c863a662812af7ac09 | [
"Apache-2.0"
] | 29 | 2017-02-28T17:43:54.000Z | 2020-06-10T08:41:23.000Z | tests/blessclient/vault_ca_test.py | mwpeterson/python-blessclient | ae9ab72fe2c62d311e22a9c863a662812af7ac09 | [
"Apache-2.0"
] | 40 | 2017-02-14T08:21:53.000Z | 2020-12-23T11:19:32.000Z | import pytest
from blessclient.vault_ca import VaultCA
import hvac
TESTVAULTCONFIG = {
'vault_addr': 'https://vault.example.com:1234'
}
def test_getCert(mocker):
clientmock = mocker.MagicMock()
clientmock.write.return_value = {
'StatusCode': 200,
'data': {
'signed_key': "The ... | 27.052632 | 62 | 0.56939 | import pytest
from blessclient.vault_ca import VaultCA
import hvac
TESTVAULTCONFIG = {
'vault_addr': 'https://vault.example.com:1234'
}
def test_getCert(mocker):
clientmock = mocker.MagicMock()
clientmock.write.return_value = {
'StatusCode': 200,
'data': {
'signed_key': "The ... | true | true |
1c0f6e6c73a55d91ee97d94a9c48863ba2d927e4 | 6,704 | py | Python | tests/network_test.py | daniele21/Financial_Sentiment_Analysis | 3734733f2d1d291c81a6239de121edcce861b463 | [
"MIT"
] | null | null | null | tests/network_test.py | daniele21/Financial_Sentiment_Analysis | 3734733f2d1d291c81a6239de121edcce861b463 | [
"MIT"
] | null | null | null | tests/network_test.py | daniele21/Financial_Sentiment_Analysis | 3734733f2d1d291c81a6239de121edcce861b463 | [
"MIT"
] | 1 | 2021-08-18T01:40:56.000Z | 2021-08-18T01:40:56.000Z | import unittest
import logging
import torch
from torch import nn
from constants.config import MOVIE_DATASET, TOKENIZER, MAX_WORD_SENTENCE, SST_DATASET
from scripts.datasets.dataloader import generate_dataloader
from scripts.datasets.dataset import NN_Dataset
from scripts.datasets.sst_dataset import Bert_NN_Dataset
fro... | 40.143713 | 130 | 0.526551 | import unittest
import logging
import torch
from torch import nn
from constants.config import MOVIE_DATASET, TOKENIZER, MAX_WORD_SENTENCE, SST_DATASET
from scripts.datasets.dataloader import generate_dataloader
from scripts.datasets.dataset import NN_Dataset
from scripts.datasets.sst_dataset import Bert_NN_Dataset
fro... | true | true |
1c0f6fc1a5b8d77f1b0b5a69431aed1f06f62dd9 | 4,629 | py | Python | src/pykeen/experiments/inverse_stability.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/experiments/inverse_stability.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/experiments/inverse_stability.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Inverse Stability Workflow.
This experiment investigates the differences between
"""
import itertools as itt
import logging
from typing import Type
import click
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import pykeen.evaluation.evaluator
from pykeen.const... | 35.607692 | 110 | 0.677252 |
import itertools as itt
import logging
from typing import Type
import click
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import pykeen.evaluation.evaluator
from pykeen.constants import PYKEEN_EXPERIMENTS
from pykeen.datasets import Dataset, get_dataset
from pykeen.models import Model, m... | true | true |
1c0f70337b42fc0ba1f9448c9136fd9a337a3edc | 5,354 | py | Python | PyPortal_Azure_Plant_Monitor/azure_gfx_helper.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | PyPortal_Azure_Plant_Monitor/azure_gfx_helper.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | PyPortal_Azure_Plant_Monitor/azure_gfx_helper.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2019 Brent Rubell for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
GFX Helper for PyPortal Azure IoT Plant Monitor
"""
import board
import displayio
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
# the current working directory (where t... | 35.223684 | 88 | 0.635786 |
import board
import displayio
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
cwd = ("/" + __file__).rsplit("/", 1)[0]
main_font = cwd + "/fonts/EarthHeart-26.bdf"
data_font = cwd + "/fonts/Collegiate-50.bdf"
class Azure_GFX(displayio.Group):
def __init__(self, is_cel... | true | true |
1c0f72790d6b98e01d0cd9baa241df1cd26a0afd | 229 | py | Python | background_task/__init__.py | mayudong07/django-background-tasks | 1288d6385ccfd53cee1e9d280aa489b68002277b | [
"BSD-3-Clause"
] | null | null | null | background_task/__init__.py | mayudong07/django-background-tasks | 1288d6385ccfd53cee1e9d280aa489b68002277b | [
"BSD-3-Clause"
] | null | null | null | background_task/__init__.py | mayudong07/django-background-tasks | 1288d6385ccfd53cee1e9d280aa489b68002277b | [
"BSD-3-Clause"
] | 4 | 2019-11-18T18:37:49.000Z | 2021-05-20T19:51:09.000Z | # -*- coding: utf-8 -*-
__version__ = '1.2.4'
default_app_config = 'background_task.apps.BackgroundTasksAppConfig'
def background(*arg, **kw):
from background_task.tasks import tasks
return tasks.background(*arg, **kw)
| 25.444444 | 68 | 0.716157 | __version__ = '1.2.4'
default_app_config = 'background_task.apps.BackgroundTasksAppConfig'
def background(*arg, **kw):
from background_task.tasks import tasks
return tasks.background(*arg, **kw)
| true | true |
1c0f72a9040e265a58875764b020391ac1bdac38 | 1,268 | py | Python | old.py | qe/github-usernames | cb7448cd32ae1e020a23a1ea0c0af83ea571cc70 | [
"MIT"
] | 3 | 2022-03-17T02:41:10.000Z | 2022-03-18T01:32:26.000Z | old.py | qe/github-username-data-aggregator | cb7448cd32ae1e020a23a1ea0c0af83ea571cc70 | [
"MIT"
] | null | null | null | old.py | qe/github-username-data-aggregator | cb7448cd32ae1e020a23a1ea0c0af83ea571cc70 | [
"MIT"
] | null | null | null |
import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", bs4])
import requests
from bs4 import BeautifulSoup
with open('simple.html') as html_file: # parses html file
soup = BeautifulSoup(html_file, 'lxml') #
#
# print(soup.prettify()) ... | 20.786885 | 138 | 0.679811 |
import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", bs4])
import requests
from bs4 import BeautifulSoup
with open('simple.html') as html_file: soup = BeautifulSoup(html_file, 'lxml')
individualArticle = soup.find('div', clas... | true | true |
1c0f761910af753bcdfbbad24b0f2c5f747fb21c | 24 | py | Python | pomo/commands/status.py | GonzalezAndrew/pomo-cli | 43dc14fde15d773eac6e9d957770e1d75e48dd38 | [
"MIT"
] | null | null | null | pomo/commands/status.py | GonzalezAndrew/pomo-cli | 43dc14fde15d773eac6e9d957770e1d75e48dd38 | [
"MIT"
] | null | null | null | pomo/commands/status.py | GonzalezAndrew/pomo-cli | 43dc14fde15d773eac6e9d957770e1d75e48dd38 | [
"MIT"
] | null | null | null |
def status():
pass | 6 | 13 | 0.541667 |
def status():
pass | true | true |
1c0f77489160fbd343de370c9dfc257a56ff9996 | 954 | py | Python | src/geomm/arrhenius.py | stxinsite/geomm | 05ce2404614e3a594c5d5e059b957140f4983bc3 | [
"MIT"
] | 3 | 2018-05-01T16:26:15.000Z | 2019-06-19T21:17:47.000Z | src/geomm/arrhenius.py | stxinsite/geomm | 05ce2404614e3a594c5d5e059b957140f4983bc3 | [
"MIT"
] | null | null | null | src/geomm/arrhenius.py | stxinsite/geomm | 05ce2404614e3a594c5d5e059b957140f4983bc3 | [
"MIT"
] | 1 | 2021-09-28T15:17:16.000Z | 2021-09-28T15:17:16.000Z | import numpy as np
import pint
unit = pint.UnitRegistry()
BOLTZMANN_CONSTANT = 1.3806504e-23 * (unit.joule / unit.kelvin)
PLANCK_CONSTANT = 6.626070e-34 * (unit.joule * unit.second)
UNIVERSAL_GAS_CONSTANT = 8.314 * (unit.joule / (unit.kelvin * unit.mole))
TRANSMISSION_COEFFICIENT = 1.0
def arrhenius_preexponent(tem... | 26.5 | 85 | 0.750524 | import numpy as np
import pint
unit = pint.UnitRegistry()
BOLTZMANN_CONSTANT = 1.3806504e-23 * (unit.joule / unit.kelvin)
PLANCK_CONSTANT = 6.626070e-34 * (unit.joule * unit.second)
UNIVERSAL_GAS_CONSTANT = 8.314 * (unit.joule / (unit.kelvin * unit.mole))
TRANSMISSION_COEFFICIENT = 1.0
def arrhenius_preexponent(tem... | true | true |
1c0f780f655f8bf61c4185249b66a4546dfdfb8f | 107 | py | Python | test/test_import.py | csyben/PYRO-NN-Layers | 9bec5ccaf62eb1fec01c1668ba1a6375673f8b12 | [
"Apache-2.0"
] | 24 | 2019-03-12T10:07:59.000Z | 2022-01-07T09:37:43.000Z | test/test_import.py | theHamsta/PYRO-NN-Layers | c776c3d7315f483937a7cebf667c6d491ecd57e6 | [
"Apache-2.0"
] | 6 | 2019-06-19T15:45:48.000Z | 2021-07-14T18:39:48.000Z | test/test_import.py | theHamsta/PYRO-NN-Layers | c776c3d7315f483937a7cebf667c6d491ecd57e6 | [
"Apache-2.0"
] | 10 | 2019-04-20T09:09:17.000Z | 2021-05-06T09:25:10.000Z | import sys
from os.path import join,dirname
sys.path.insert(0,dirname(__file__))
import pyronn_layers_dev
| 17.833333 | 36 | 0.82243 | import sys
from os.path import join,dirname
sys.path.insert(0,dirname(__file__))
import pyronn_layers_dev
| true | true |
1c0f78b5eba854fa460105f6b5de516733cf5959 | 2,063 | py | Python | src/pytorch_metric_learning/trainers/twostream_metric_loss.py | wconnell/pytorch-metric-learning | 1affee7c77bb5d6d4ee559bad62b910a21b39d48 | [
"MIT"
] | 1 | 2021-01-27T03:36:19.000Z | 2021-01-27T03:36:19.000Z | src/pytorch_metric_learning/trainers/twostream_metric_loss.py | umitkacar/pytorch-metric-learning | bf2b7675b7b80e5762b75428d51e4ab0a861e710 | [
"MIT"
] | null | null | null | src/pytorch_metric_learning/trainers/twostream_metric_loss.py | umitkacar/pytorch-metric-learning | bf2b7675b7b80e5762b75428d51e4ab0a861e710 | [
"MIT"
] | null | null | null | from .base_trainer import BaseTrainer
from ..utils import common_functions as c_f, loss_and_miner_utils as lmu
import logging
import torch
class TwoStreamMetricLoss(BaseTrainer):
def calculate_loss(self, curr_batch):
(anchors, posnegs), labels = curr_batch
embeddings = (self.compute_embeddings(anc... | 49.119048 | 115 | 0.718856 | from .base_trainer import BaseTrainer
from ..utils import common_functions as c_f, loss_and_miner_utils as lmu
import logging
import torch
class TwoStreamMetricLoss(BaseTrainer):
def calculate_loss(self, curr_batch):
(anchors, posnegs), labels = curr_batch
embeddings = (self.compute_embeddings(anc... | true | true |
1c0f792d93e07e7a48482258b67938b97421a9e1 | 53,660 | py | Python | py_insightvm_sdk/models/scan_template_database.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 2 | 2019-03-15T16:05:54.000Z | 2020-07-19T18:37:50.000Z | py_insightvm_sdk/models/scan_template_database.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 1 | 2021-03-26T04:46:12.000Z | 2021-03-26T04:51:23.000Z | py_insightvm_sdk/models/scan_template_database.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 263.039216 | 48,045 | 0.495658 |
import pprint
import re
import six
from py_insightvm_sdk.models.link import Link
class ScanTemplateDatabase(object):
swagger_types = {
'db2': 'str',
'links': 'list[Link]',
'oracle': 'list[str]',
'postgres': 'str'
}
attribute_map = {
'db2': 'db2',
'l... | true | true |
1c0f7964ff2f1ab896655b903de865148274c146 | 1,774 | py | Python | Lesson3/mann_whitney_subway_data.py | rmhyman/DataScience | c839c97c76f104ab298563a5c8b48f6d90be5f60 | [
"MIT"
] | 1 | 2015-09-17T18:49:09.000Z | 2015-09-17T18:49:09.000Z | Lesson3/mann_whitney_subway_data.py | rmhyman/DataScience | c839c97c76f104ab298563a5c8b48f6d90be5f60 | [
"MIT"
] | null | null | null | Lesson3/mann_whitney_subway_data.py | rmhyman/DataScience | c839c97c76f104ab298563a5c8b48f6d90be5f60 | [
"MIT"
] | null | null | null | import numpy as np
import scipy
import scipy.stats
import pandas
def mann_whitney_plus_means(turnstile_weather):
'''
This function will consume the turnstile_weather dataframe containing
our final turnstile weather data.
You will want to take the means and run the Mann Whitney U-test on... | 44.35 | 96 | 0.689966 | import numpy as np
import scipy
import scipy.stats
import pandas
def mann_whitney_plus_means(turnstile_weather):
entries_with_rain = turnstile_weather[turnstile_weather['rain'] == 1]['ENTRIESn_hourly']
entries_without_rain = turnstile_weather[turnstile_weather['rain'] == 0]['ENTRIESn_hourly']
... | true | true |
1c0f7a9c9046e35589d4444daea5323b5709a6fb | 4,002 | py | Python | data/dataset.py | HaiNguyen2903/Faster-RCNN | 78d249a07dae0c9dad095543dab6385394c8dc0a | [
"MIT"
] | null | null | null | data/dataset.py | HaiNguyen2903/Faster-RCNN | 78d249a07dae0c9dad095543dab6385394c8dc0a | [
"MIT"
] | null | null | null | data/dataset.py | HaiNguyen2903/Faster-RCNN | 78d249a07dae0c9dad095543dab6385394c8dc0a | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
import torch as t
from data.voc_dataset import VOCBboxDataset
from skimage import transform as sktsf
# import skimage.transform as sktsf
from torchvision import transforms as tvtsf
from data import util
import numpy as np
from utils.config import ... | 30.549618 | 92 | 0.633683 | from __future__ import absolute_import
from __future__ import division
import torch as t
from data.voc_dataset import VOCBboxDataset
from skimage import transform as sktsf
from torchvision import transforms as tvtsf
from data import util
import numpy as np
from utils.config import opt
def inverse_normalize(img):
... | true | true |
1c0f7ab5e90fe5820aabb9cb05553e48a1b8236f | 926 | py | Python | server.py | jinjun1994/valentine | 54e2d3a28d9717b95a365daf2504f19976475d9e | [
"MIT"
] | 94 | 2015-02-14T05:13:01.000Z | 2022-02-10T03:07:59.000Z | server.py | phodal/valentina | 2bc9999fec1f17a2eec32efc6afceafb2a28d3db | [
"MIT"
] | 1 | 2020-12-30T15:09:25.000Z | 2020-12-30T15:09:25.000Z | server.py | phodal/valentina | 2bc9999fec1f17a2eec32efc6afceafb2a28d3db | [
"MIT"
] | 52 | 2015-01-26T02:23:16.000Z | 2022-03-26T07:40:08.000Z | import json
import time
from flask import Flask, request
from flask_restful import Resource, Api
import serial
ser = serial.Serial("/dev/ttyACM0", 9600)
app = Flask(__name__, static_url_path='')
app.secret_key = 'why would I tell you my secret key?'
api = Api(app)
tasks = {}
@app.route('/')
def root():
return ... | 21.534884 | 72 | 0.638229 | import json
import time
from flask import Flask, request
from flask_restful import Resource, Api
import serial
ser = serial.Serial("/dev/ttyACM0", 9600)
app = Flask(__name__, static_url_path='')
app.secret_key = 'why would I tell you my secret key?'
api = Api(app)
tasks = {}
@app.route('/')
def root():
return ... | true | true |
1c0f7b3f37a9d576d04b90c41e4814f312bb3f3a | 3,927 | py | Python | tests/components/fritzbox/test_switch.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | tests/components/fritzbox/test_switch.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 60 | 2020-08-03T07:32:56.000Z | 2022-03-31T06:02:07.000Z | tests/components/fritzbox/test_switch.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Tests for AVM Fritz!Box switch component."""
from datetime import timedelta
from unittest.mock import Mock
from requests.exceptions import HTTPError
from homeassistant.components.fritzbox.const import (
ATTR_STATE_DEVICE_LOCKED,
ATTR_STATE_LOCKED,
ATTR_TEMPERATURE_UNIT,
ATTR_TOTAL_CONSUMPTION,
... | 32.188525 | 81 | 0.747899 | from datetime import timedelta
from unittest.mock import Mock
from requests.exceptions import HTTPError
from homeassistant.components.fritzbox.const import (
ATTR_STATE_DEVICE_LOCKED,
ATTR_STATE_LOCKED,
ATTR_TEMPERATURE_UNIT,
ATTR_TOTAL_CONSUMPTION,
ATTR_TOTAL_CONSUMPTION_UNIT,
DOMAIN as FB_DO... | true | true |
1c0f7b99542602fb31747510e9aad42b33095746 | 4,028 | py | Python | eng/tox/sanitize_setup.py | letmaik/azure-sdk-for-python | 4ed6294caef4699534c56c9d840f379bced1ab6f | [
"MIT"
] | null | null | null | eng/tox/sanitize_setup.py | letmaik/azure-sdk-for-python | 4ed6294caef4699534c56c9d840f379bced1ab6f | [
"MIT"
] | null | null | null | eng/tox/sanitize_setup.py | letmaik/azure-sdk-for-python | 4ed6294caef4699534c56c9d840f379bced1ab6f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 38.730769 | 111 | 0.668073 |
import argparse
import sys
import os
import logging
import glob
from packaging.specifiers import SpecifierSet
from pkg_resources import Requirement
from pypi_tools.pypi import PyPIClient
root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", ".."))
setup_parser_path = os.path.abspath(os.path... | true | true |
1c0f7bd51104357cbe327372c68388b9bb16fdd4 | 4,806 | py | Python | tests/test_variables_dfd.py | micahhausler/fluentm | eb2fccbecfb52dc8587bba76866d8de12236dc92 | [
"Apache-2.0"
] | null | null | null | tests/test_variables_dfd.py | micahhausler/fluentm | eb2fccbecfb52dc8587bba76866d8de12236dc92 | [
"Apache-2.0"
] | null | null | null | tests/test_variables_dfd.py | micahhausler/fluentm | eb2fccbecfb52dc8587bba76866d8de12236dc92 | [
"Apache-2.0"
] | null | null | null | from fluentm import Actor, Boundary, Process, Data, DataFlow
from fluentm import dfd, renderDfd
# fluentTM Classes are scoped by name, so, I can only have one Boundary called "Internet"
# Attempting to instantiate another with the same name will give you the first one you instantiated
# However, if, for reasons, you w... | 41.791304 | 149 | 0.703912 | from fluentm import Actor, Boundary, Process, Data, DataFlow
from fluentm import dfd, renderDfd
Actor("Customer").inBoundary(
"Internet"
)
Boundary("BookStore Co")
Boundary("Front End Systems").inBoundary(Boundary.get("BookStore Co"))
Boundary("Databases").inBoundary(Boundary.get("BookStore Co"))
Boundary("Vi... | true | true |
1c0f7c781f3bf31ae246341008b8d6b3a29bc7cb | 6,028 | py | Python | dfCollate/dfCollate.py | turoger/df_Collate | 4c4266fc7074957ca44d5085e915ea6c47123193 | [
"BSD-3-Clause"
] | null | null | null | dfCollate/dfCollate.py | turoger/df_Collate | 4c4266fc7074957ca44d5085e915ea6c47123193 | [
"BSD-3-Clause"
] | null | null | null | dfCollate/dfCollate.py | turoger/df_Collate | 4c4266fc7074957ca44d5085e915ea6c47123193 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import os
import dask.dataframe as ddf
import pandas as pd
import numpy as np
#
def big_ddf (directory_to_traits_table,
directory_to_phenotypes, phenotype_list, filename_type,
directory_to_MAF,
gene_name, directory_to_rsid):
... | 39.92053 | 146 | 0.549602 |
import os
import dask.dataframe as ddf
import pandas as pd
import numpy as np
def big_ddf (directory_to_traits_table,
directory_to_phenotypes, phenotype_list, filename_type,
directory_to_MAF,
gene_name, directory_to_rsid):
trait_dict = ukbbTT_to_dict(directory_to_traits_... | true | true |
1c0f7d5d2a77ca783027dce820f6cb7396e6b666 | 4,405 | py | Python | datastructure_collection/linkedList.py | nyakaz73/datastructure_collection | 19922d8d9f95b3588daaafb780c02fa0196d9790 | [
"MIT"
] | 1 | 2020-07-27T21:01:37.000Z | 2020-07-27T21:01:37.000Z | datastructure_collection/linkedList.py | nyakaz73/datastructure_collection | 19922d8d9f95b3588daaafb780c02fa0196d9790 | [
"MIT"
] | null | null | null | datastructure_collection/linkedList.py | nyakaz73/datastructure_collection | 19922d8d9f95b3588daaafb780c02fa0196d9790 | [
"MIT"
] | null | null | null | '''
Why linked Lists over array or general Lists
-Linked List Insertion O(1)
-Lists Insrtion is O(n) since the if shifting of elements in inserions and deletion
when rehashing or resizing the List
'''
class _Node:
def __init__(self,data):
self.data = data
self.next = None
class LinkedList:
def... | 31.021127 | 106 | 0.558229 |
class _Node:
def __init__(self,data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self._head = None
self._tail = None
self._count = 0
def add(self,data):
new_node = _Node(data)
new_node.next = self._head ... | true | true |
1c0f7d7a11f8196d2fc3f4ca915d57a6ff694300 | 194 | py | Python | code/model.py | tomiyee/6.806-Card-Translation | 9286b232f60ec53fabbbcbeca23ddd71cd6c3483 | [
"MIT"
] | null | null | null | code/model.py | tomiyee/6.806-Card-Translation | 9286b232f60ec53fabbbcbeca23ddd71cd6c3483 | [
"MIT"
] | null | null | null | code/model.py | tomiyee/6.806-Card-Translation | 9286b232f60ec53fabbbcbeca23ddd71cd6c3483 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
class Card2CodeModel(nn.Module):
def __init__(self):
self.linear = nn.Linear(5,5)
def forward(self, inputs=None):
return self.linear(inputs)
| 19.4 | 33 | 0.701031 | import torch
import torch.nn as nn
class Card2CodeModel(nn.Module):
def __init__(self):
self.linear = nn.Linear(5,5)
def forward(self, inputs=None):
return self.linear(inputs)
| true | true |
1c0f7e4445ae42acb365d36faf4382a33a331e4c | 9,560 | py | Python | pystruct/tests/test_models/test_latent_node_crf.py | stefanoteso/pystruct | 3bafeab13eea82fa6f3077686b951bf76d810a8d | [
"BSD-2-Clause"
] | null | null | null | pystruct/tests/test_models/test_latent_node_crf.py | stefanoteso/pystruct | 3bafeab13eea82fa6f3077686b951bf76d810a8d | [
"BSD-2-Clause"
] | null | null | null | pystruct/tests/test_models/test_latent_node_crf.py | stefanoteso/pystruct | 3bafeab13eea82fa6f3077686b951bf76d810a8d | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal, assert_almost_equal)
from nose.tools import assert_raises
from pystruct.datasets import generate_blocks_multinomial
from pystruct.inference.linear_programming import lp_general_graph
f... | 38.704453 | 78 | 0.615377 | import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal, assert_almost_equal)
from nose.tools import assert_raises
from pystruct.datasets import generate_blocks_multinomial
from pystruct.inference.linear_programming import lp_general_graph
f... | true | true |
1c0f7fb88541bea84f5f765df89050d2cffd7f88 | 320 | py | Python | src/room.py | filchyboy/python-intro-2 | f3c85e96fb3dfa4e652b8eff96f7899268013ef7 | [
"MIT"
] | null | null | null | src/room.py | filchyboy/python-intro-2 | f3c85e96fb3dfa4e652b8eff96f7899268013ef7 | [
"MIT"
] | null | null | null | src/room.py | filchyboy/python-intro-2 | f3c85e96fb3dfa4e652b8eff96f7899268013ef7 | [
"MIT"
] | null | null | null | # Implement a class to hold room information. This should have name and
# description attributes.
class Room():
def __init__(self, name, description):
self.name = name
self.description = description
self.n_to = None
self.e_to = None
self.s_to = None
self.w_to = None | 26.666667 | 71 | 0.634375 |
class Room():
def __init__(self, name, description):
self.name = name
self.description = description
self.n_to = None
self.e_to = None
self.s_to = None
self.w_to = None | true | true |
1c0f7fdd0d04c3e2e0c18983395412ce9267d4ae | 2,562 | py | Python | tests/unit/test_hooks.py | lust4life/uplink | 44d7dcce1b40029e325c831c9e5683c41081c524 | [
"MIT"
] | null | null | null | tests/unit/test_hooks.py | lust4life/uplink | 44d7dcce1b40029e325c831c9e5683c41081c524 | [
"MIT"
] | null | null | null | tests/unit/test_hooks.py | lust4life/uplink | 44d7dcce1b40029e325c831c9e5683c41081c524 | [
"MIT"
] | null | null | null | # Third-party imports
import pytest
# Local imports
from uplink import hooks
class TestResponseHandler(object):
def test_handle_response(self, mocker):
converter = mocker.Mock()
input_value = "converted"
converter.return_value = input_value
rc = hooks.ResponseHandler(converter)
... | 35.09589 | 80 | 0.700625 | import pytest
from uplink import hooks
class TestResponseHandler(object):
def test_handle_response(self, mocker):
converter = mocker.Mock()
input_value = "converted"
converter.return_value = input_value
rc = hooks.ResponseHandler(converter)
assert rc.handle_response(None) ... | true | true |
1c0f80997d12ddd8f7fd81893657ae289a1e5cb2 | 2,071 | py | Python | rowboat/util/input.py | NoahH99/Warcoat | d494a7e04114ff7d67ff59517874b7383c414663 | [
"MIT"
] | 19 | 2018-05-17T22:42:27.000Z | 2022-03-31T18:29:48.000Z | rowboat/util/input.py | NoahH99/Warcoat | d494a7e04114ff7d67ff59517874b7383c414663 | [
"MIT"
] | 15 | 2018-10-10T01:35:43.000Z | 2021-12-13T20:02:08.000Z | rowboat/util/input.py | NoahH99/Warcoat | d494a7e04114ff7d67ff59517874b7383c414663 | [
"MIT"
] | 24 | 2017-10-09T10:52:58.000Z | 2021-11-29T20:53:36.000Z | from datetime import datetime, timedelta
from disco.bot.command import CommandError
UNITS = {
's': lambda v: v,
'm': lambda v: v * 60,
'h': lambda v: v * 60 * 60,
'd': lambda v: v * 60 * 60 * 24,
'w': lambda v: v * 60 * 60 * 24 * 7,
}
def parse_duration(raw, source=None, negative=False, safe=Fal... | 27.613333 | 86 | 0.54225 | from datetime import datetime, timedelta
from disco.bot.command import CommandError
UNITS = {
's': lambda v: v,
'm': lambda v: v * 60,
'h': lambda v: v * 60 * 60,
'd': lambda v: v * 60 * 60 * 24,
'w': lambda v: v * 60 * 60 * 24 * 7,
}
def parse_duration(raw, source=None, negative=False, safe=Fal... | true | true |
1c0f81b04ea7e7dc244946f5cdf4b5279c40dc00 | 591 | py | Python | utils/ds.py | 0x48piraj/DomRadar | eac384bef637b0834f9dc388494837ed792488e5 | [
"MIT"
] | null | null | null | utils/ds.py | 0x48piraj/DomRadar | eac384bef637b0834f9dc388494837ed792488e5 | [
"MIT"
] | null | null | null | utils/ds.py | 0x48piraj/DomRadar | eac384bef637b0834f9dc388494837ed792488e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, glob
import os.path as path
import pathlib
ROOT_DIR = pathlib.Path(__file__).parents[1].joinpath('datasets')
def load_all():
datasets = ROOT_DIR.rglob('*.txt')
_all = []
for dataset in datasets:
words = open(dataset, 'r').read().splitlines()
for word ... | 21.107143 | 65 | 0.686971 |
import os, glob
import os.path as path
import pathlib
ROOT_DIR = pathlib.Path(__file__).parents[1].joinpath('datasets')
def load_all():
datasets = ROOT_DIR.rglob('*.txt')
_all = []
for dataset in datasets:
words = open(dataset, 'r').read().splitlines()
for word in words:
_all.append(word)
return _all
de... | true | true |
1c0f822d738d2b888ad4c5be233b495f7b9eccad | 6,777 | py | Python | keywordsgen.py | TaylorCoons/corker | 283d8d93b8bb2fbf40833e46d6b61925cbfbea06 | [
"Unlicense"
] | null | null | null | keywordsgen.py | TaylorCoons/corker | 283d8d93b8bb2fbf40833e46d6b61925cbfbea06 | [
"Unlicense"
] | null | null | null | keywordsgen.py | TaylorCoons/corker | 283d8d93b8bb2fbf40833e46d6b61925cbfbea06 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
import os
import re
import copy
class Keyword:
name = None
keyword = None
def __init__(self, name, keyword):
self.name = name
self.keyword = keyword
def __repr__(self):
return 'Keyword()'
def __str__(self):
return '{}\t{}'.format(... | 26.786561 | 96 | 0.50273 |
import os
import re
import copy
class Keyword:
name = None
keyword = None
def __init__(self, name, keyword):
self.name = name
self.keyword = keyword
def __repr__(self):
return 'Keyword()'
def __str__(self):
return '{}\t{}'.format(self.name, self.key... | true | true |
1c0f8289f2b45595fed1ab81ff36dbc2d503d5e0 | 21,352 | py | Python | proj/lib/python3.7/site-packages/cffi/model.py | shahedex/horizon_backend_flask | 7dce74fce0afdfa1cb6481e1d765e01a8ad3c5c4 | [
"MIT"
] | 1 | 2017-01-14T15:20:35.000Z | 2017-01-14T15:20:35.000Z | proj/lib/python3.7/site-packages/cffi/model.py | shahedex/horizon_backend_flask | 7dce74fce0afdfa1cb6481e1d765e01a8ad3c5c4 | [
"MIT"
] | 4 | 2017-02-20T02:33:48.000Z | 2017-02-20T04:10:16.000Z | proj/lib/python3.7/site-packages/cffi/model.py | shahedex/horizon_backend_flask | 7dce74fce0afdfa1cb6481e1d765e01a8ad3c5c4 | [
"MIT"
] | 2 | 2019-04-29T14:16:10.000Z | 2020-07-23T12:04:17.000Z | import types, sys
import weakref
from .lock import allocate_lock
# type qualifiers
Q_CONST = 0x01
Q_RESTRICT = 0x02
Q_VOLATILE = 0x04
def qualify(quals, replace_with):
if quals & Q_CONST:
replace_with = ' const ' + replace_with.lstrip()
if quals & Q_VOLATILE:
replace_with = ' volatile ' +... | 35.060755 | 79 | 0.566504 | import types, sys
import weakref
from .lock import allocate_lock
Q_CONST = 0x01
Q_RESTRICT = 0x02
Q_VOLATILE = 0x04
def qualify(quals, replace_with):
if quals & Q_CONST:
replace_with = ' const ' + replace_with.lstrip()
if quals & Q_VOLATILE:
replace_with = ' volatile ' + replace_with.lstr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.