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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c14a76df49a946cc4c366156d6892c61356eed3 | 3,484 | py | Python | account/models.py | PUANEY/OnlineJudge | 9756e0c7db82ce6882a07594364726be48530bd2 | [
"MIT"
] | null | null | null | account/models.py | PUANEY/OnlineJudge | 9756e0c7db82ce6882a07594364726be48530bd2 | [
"MIT"
] | null | null | null | account/models.py | PUANEY/OnlineJudge | 9756e0c7db82ce6882a07594364726be48530bd2 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractBaseUser
from django.conf import settings
from django.db import models
from utils.models import JSONField
class AdminType(object):
REGULAR_USER = "Regular User"
ADMIN = "Admin"
SUPER_ADMIN = "Super Admin"
class ProblemPermission(object):
NONE = "None"
... | 32.560748 | 113 | 0.719575 | from django.contrib.auth.models import AbstractBaseUser
from django.conf import settings
from django.db import models
from utils.models import JSONField
class AdminType(object):
REGULAR_USER = "Regular User"
ADMIN = "Admin"
SUPER_ADMIN = "Super Admin"
class ProblemPermission(object):
NONE = "None"
... | true | true |
1c14a82c2b12c0c3724e01e728710879de780bec | 368 | py | Python | MACHINE_LEARNING/1_stadistics_review.py | Frenzoid/labs | 3552c604445d1a9c79ec9f53b274b3890c23991e | [
"MIT"
] | 2 | 2021-08-02T18:41:05.000Z | 2022-03-31T13:25:44.000Z | MACHINE_LEARNING/1_stadistics_review.py | Frenzoid/labs | 3552c604445d1a9c79ec9f53b274b3890c23991e | [
"MIT"
] | null | null | null | MACHINE_LEARNING/1_stadistics_review.py | Frenzoid/labs | 3552c604445d1a9c79ec9f53b274b3890c23991e | [
"MIT"
] | 2 | 2021-09-01T01:35:21.000Z | 2022-03-08T03:40:45.000Z |
import numpy as np
data = [15, 16, 18, 19, 22, 24, 29, 30, 34]
print("mean:", np.mean(data))
print("median:", np.median(data))
print("50th percentile (median):", np.percentile(data, 50))
print("25th percentile:", np.percentile(data, 25))
print("75th percentile:", np.percentile(data, 75))
print("standard deviation:",... | 28.307692 | 59 | 0.67663 |
import numpy as np
data = [15, 16, 18, 19, 22, 24, 29, 30, 34]
print("mean:", np.mean(data))
print("median:", np.median(data))
print("50th percentile (median):", np.percentile(data, 50))
print("25th percentile:", np.percentile(data, 25))
print("75th percentile:", np.percentile(data, 75))
print("standard deviation:",... | true | true |
1c14a82e1744c942978ec38d71f175d64e37b06e | 626 | py | Python | python/misc/max_sum_contiguous_subarray.py | kumaratinfy/Problem-Solving | be9e3b8a630e4126f150b9e7f03c2f3290ba3255 | [
"MIT"
] | null | null | null | python/misc/max_sum_contiguous_subarray.py | kumaratinfy/Problem-Solving | be9e3b8a630e4126f150b9e7f03c2f3290ba3255 | [
"MIT"
] | null | null | null | python/misc/max_sum_contiguous_subarray.py | kumaratinfy/Problem-Solving | be9e3b8a630e4126f150b9e7f03c2f3290ba3255 | [
"MIT"
] | null | null | null | # https://www.interviewbit.com/problems/max-sum-contiguous-subarray/
#
# Main Idea : Keep on adding terms starting from index 0 till the time cumulative sum is positive.
# As long sum is positve it has something to contribute to the overall sum
def maxSubArray(A):
maxsum = float("-inf")
currsum = 0
... | 24.076923 | 99 | 0.554313 |
def maxSubArray(A):
maxsum = float("-inf")
currsum = 0
i = 0
while i < len(A):
currsum += A[i]
if currsum > maxsum:
maxsum = currsum
if currsum < 0:
currsum = 0
i += 1
return maxsum
def test():
asser... | true | true |
1c14a8a5d40c0eaed418385da196aea578e43d56 | 2,662 | py | Python | docs/source/user_guide/calculations/output_node_example.py | sphuber/aiida-fleur | df33e9a7b993a52c15a747a4ff23be3e19832b8d | [
"MIT"
] | 7 | 2020-03-13T22:49:12.000Z | 2022-01-21T08:11:22.000Z | docs/source/user_guide/calculations/output_node_example.py | sphuber/aiida-fleur | df33e9a7b993a52c15a747a4ff23be3e19832b8d | [
"MIT"
] | 127 | 2018-11-27T09:06:32.000Z | 2022-03-31T10:21:26.000Z | docs/source/user_guide/calculations/output_node_example.py | broeder-j/aiida_fleur_plugin | cca54b194f4b217abb69aaa1fca0db52c6c830c3 | [
"MIT"
] | 6 | 2018-11-09T08:47:35.000Z | 2022-03-18T14:17:19.000Z | # -*- coding: utf-8 -*-
(aiidapy)% verdi data dict show 425
{
'CalcJob_uuid': 'a6511a00-7759-484a-839d-c100dafd6118',
'bandgap': 0.0029975592,
'bandgap_units': 'eV',
'charge_den_xc_den_integral': -3105.2785777045,
'charge_density1': 3.55653e-05,
'charge_density2': 6.70788e-05,
'creator_name'... | 27.443299 | 61 | 0.587528 | (aiidapy)% verdi data dict show 425
{
'CalcJob_uuid': 'a6511a00-7759-484a-839d-c100dafd6118',
'bandgap': 0.0029975592,
'bandgap_units': 'eV',
'charge_den_xc_den_integral': -3105.2785777045,
'charge_density1': 3.55653e-05,
'charge_density2': 6.70788e-05,
'creator_name': 'fleur 27',
'creat... | false | true |
1c14a8c5ade1370f63519fb6f22647e67b2b3c0d | 473 | py | Python | 104.py | geethakamath18/Leetcode | 8e55e0a47ee35ed100b30dda6682c7ce1033d4b2 | [
"MIT"
] | null | null | null | 104.py | geethakamath18/Leetcode | 8e55e0a47ee35ed100b30dda6682c7ce1033d4b2 | [
"MIT"
] | null | null | null | 104.py | geethakamath18/Leetcode | 8e55e0a47ee35ed100b30dda6682c7ce1033d4b2 | [
"MIT"
] | null | null | null | #LeetCode problem 104: Maximum Depth of Binary Tree
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def maxDepth(self, root: TreeNode) -> int:
if r... | 31.533333 | 55 | 0.591966 | class Solution:
def maxDepth(self, root: TreeNode) -> int:
if root is None:
return 0
l=self.maxDepth(root.left)
r=self.maxDepth(root.right)
if l>r: return l+1
return r+1 | true | true |
1c14a933eab958aedeb2748d83cfd9f4808df863 | 10,765 | py | Python | cloudroast/cloudkeep/barbican/fixtures.py | kurhula/cloudroast | dcccce6b3af9d150cb667fc05bd051e97b5f6e2c | [
"Apache-2.0"
] | null | null | null | cloudroast/cloudkeep/barbican/fixtures.py | kurhula/cloudroast | dcccce6b3af9d150cb667fc05bd051e97b5f6e2c | [
"Apache-2.0"
] | null | null | null | cloudroast/cloudkeep/barbican/fixtures.py | kurhula/cloudroast | dcccce6b3af9d150cb667fc05bd051e97b5f6e2c | [
"Apache-2.0"
] | 1 | 2020-04-13T17:47:04.000Z | 2020-04-13T17:47:04.000Z | """
Copyright 2013 Rackspace
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
dist... | 38.446429 | 78 | 0.669299 | from os import path
from uuid import uuid4
from cafe.drivers.unittest.datasets import DatasetList
from cafe.drivers.unittest.fixtures import BaseTestFixture
from cloudcafe.cloudkeep.barbican.version.client import VersionClient
from cloudcafe.cloudkeep.barbican.secrets.client import SecretsClient
from cloudcafe.cloudke... | true | true |
1c14a95f6ccf8f0673b1e2fb3dc8a0eede12a806 | 19,542 | py | Python | pyflocker/locker.py | fossabot/pyflocker | 293df31e32fb796df5c7fba803846c9872e67485 | [
"MIT"
] | null | null | null | pyflocker/locker.py | fossabot/pyflocker | 293df31e32fb796df5c7fba803846c9872e67485 | [
"MIT"
] | null | null | null | pyflocker/locker.py | fossabot/pyflocker | 293df31e32fb796df5c7fba803846c9872e67485 | [
"MIT"
] | null | null | null | """
Provides functions to encrypt and decrypt files using AES cipher.
Tip:
The name ``encryptor`` or something like that sounds more appropriate for
the name of the module and the functions, but the damage is done already.
The Header
----------
The header is used to store the important bits of data that will... | 30.34472 | 79 | 0.616109 | from __future__ import annotations
import os
import struct
import typing
from collections import namedtuple
from functools import partial
from hashlib import pbkdf2_hmac
from typing import TYPE_CHECKING
from .ciphers import exc
from .ciphers.interfaces import AES
from .ciphers.modes import AEAD, SPECIAL, Modes
if TY... | true | true |
1c14a964046e20e2b001d411ae890628296c94a7 | 2,813 | py | Python | bqplot/colorschemes.py | jasongrout/bqplot | 2416a146296419340b8d5998bf9d1538e6750579 | [
"Apache-2.0"
] | 4 | 2020-12-17T21:19:00.000Z | 2021-09-22T04:09:11.000Z | bqplot/colorschemes.py | maartenbreddels/bqplot | cbd37f7acf94c8dddf929e9d2485d2b102ce49b9 | [
"Apache-2.0"
] | 2 | 2017-12-15T11:13:17.000Z | 2017-12-15T18:13:42.000Z | bqplot/colorschemes.py | jasongrout/bqplot | 2416a146296419340b8d5998bf9d1538e6750579 | [
"Apache-2.0"
] | 1 | 2021-08-29T09:38:02.000Z | 2021-08-29T09:38:02.000Z |
# These color schemes come from d3: http://d3js.org/
#
# They are licensed under the following license:
#
# Copyright (c) 2010-2015, Michael Bostock
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | 51.145455 | 80 | 0.672236 |
CATEGORY10 = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b',
'#e377c2', '#7f7f7f', '#bcbd22', '#17becf']
CATEGORY20 = ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a',
'#d62728', '#ff9896', '#9467bd', '#c5b0d5', '#8c564b', '#c49c94',
'#e3... | true | true |
1c14aa3f655e838983eec9b85dcaab73f175673c | 3,217 | py | Python | data/p2DJ/New/program/qiskit/QC/startQiskit_QC212.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/QC/startQiskit_QC212.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/QC/startQiskit_QC212.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=12
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... | 28.469027 | 82 | 0.625117 | import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def bui... | true | true |
1c14aaaee13d75d7a1875521090130a02d86111b | 1,693 | py | Python | filtering_content.py | cicr99/Flag-Bearers-in-1968-Olympics | 3208a1d372e980a81f953e6d1896738fc2ec6c7a | [
"MIT"
] | null | null | null | filtering_content.py | cicr99/Flag-Bearers-in-1968-Olympics | 3208a1d372e980a81f953e6d1896738fc2ec6c7a | [
"MIT"
] | null | null | null | filtering_content.py | cicr99/Flag-Bearers-in-1968-Olympics | 3208a1d372e980a81f953e6d1896738fc2ec6c7a | [
"MIT"
] | null | null | null | import json
import googletrans
def main():
with open('all.json', 'r') as fd:
all_c = json.load(fd)
domains = { item['name'] : item['alpha2Code'] for item in all_c}
with open('domains.json', 'w') as fd:
fd.write(json.dumps(domains, indent=4, ensure_ascii=False))
with open('raw_data.jso... | 27.754098 | 86 | 0.526285 | import json
import googletrans
def main():
with open('all.json', 'r') as fd:
all_c = json.load(fd)
domains = { item['name'] : item['alpha2Code'] for item in all_c}
with open('domains.json', 'w') as fd:
fd.write(json.dumps(domains, indent=4, ensure_ascii=False))
with open('raw_data.jso... | true | true |
1c14ab285948f46001c3a63cfd437dcf7d997c49 | 2,724 | py | Python | Density-Based Clustering.py | GauravSahani1417/Unsupervised-Learning | 5fb4188061b950f62c1cfd8c0fc0a24bf2d4f913 | [
"MIT"
] | 7 | 2018-09-19T11:58:44.000Z | 2022-01-25T03:37:36.000Z | Density-Based Clustering.py | GauravSahani1417/Unsupervised-Learning | 5fb4188061b950f62c1cfd8c0fc0a24bf2d4f913 | [
"MIT"
] | 1 | 2018-06-21T09:35:45.000Z | 2018-06-21T09:35:45.000Z | Density-Based Clustering.py | GauravSahani1417/Unsupervised-Learning | 5fb4188061b950f62c1cfd8c0fc0a24bf2d4f913 | [
"MIT"
] | 6 | 2018-09-15T11:57:10.000Z | 2022-01-06T16:32:09.000Z | import numpy as np
from sklearn.cluster import DBSCAN
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
# Create random data and store in feature matrix X and response vector y
X, y = make_blobs(n_samples=1500, centers=[[2, 1], [-... | 34.05 | 118 | 0.64207 | import numpy as np
from sklearn.cluster import DBSCAN
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
X, y = make_blobs(n_samples=1500, centers=[[2, 1], [-4, -2], [1, -4]], cluster_std=0.7)
X = StandardScaler().fit_transform(X)... | true | true |
1c14ac1a59e6d0ecbe4a1acf7819b0bc3c525a72 | 26,161 | py | Python | guilded/gateway.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | 79 | 2020-09-19T22:48:04.000Z | 2022-03-25T03:49:26.000Z | guilded/gateway.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | 19 | 2020-09-07T21:54:42.000Z | 2022-02-08T05:08:05.000Z | guilded/gateway.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | 24 | 2020-09-05T16:28:42.000Z | 2022-03-16T02:31:10.000Z | """
MIT License
Copyright (c) 2020-present shay (shayypy)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 38.528719 | 126 | 0.615343 |
import aiohttp
import asyncio
import concurrent.futures
import datetime
import json
import logging
import sys
import threading
import traceback
from guilded.abc import TeamChannel
from .errors import GuildedException
from .channel import *
from .message import Message
from .presence import Presence
from .user import... | true | true |
1c14acbe7d75ee5186befc84ee26a9ccbbc05d74 | 4,426 | py | Python | tools/nntool/interpreter/commands/qtune.py | mfkiwl/gap_sdk | 642b798dfdc7b85ccabe6baba295033f0eadfcd4 | [
"Apache-2.0"
] | null | null | null | tools/nntool/interpreter/commands/qtune.py | mfkiwl/gap_sdk | 642b798dfdc7b85ccabe6baba295033f0eadfcd4 | [
"Apache-2.0"
] | null | null | null | tools/nntool/interpreter/commands/qtune.py | mfkiwl/gap_sdk | 642b798dfdc7b85ccabe6baba295033f0eadfcd4 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | 42.152381 | 86 | 0.683461 |
from cmd2 import with_argparser
from interpreter.nntool_shell_base import (NODE_SELECTOR_HELP,
NNToolArguementParser,
NNToolShellBase)
from quantization.handlers_helpers import (add_options_to_parser,
... | true | true |
1c14ad97a1062d537880e455f15e81c85a4f160f | 2,526 | py | Python | espnet2/layers/time_warp.py | texpomru13/espnet | 7ef005e832e2fb033f356c16f54e0f08762fb4b0 | [
"Apache-2.0"
] | 5,053 | 2017-12-13T06:21:41.000Z | 2022-03-31T13:38:29.000Z | espnet2/layers/time_warp.py | texpomru13/espnet | 7ef005e832e2fb033f356c16f54e0f08762fb4b0 | [
"Apache-2.0"
] | 3,666 | 2017-12-14T05:58:50.000Z | 2022-03-31T22:11:49.000Z | espnet2/layers/time_warp.py | texpomru13/espnet | 7ef005e832e2fb033f356c16f54e0f08762fb4b0 | [
"Apache-2.0"
] | 1,709 | 2017-12-13T01:02:42.000Z | 2022-03-31T11:57:45.000Z | """Time warp module."""
import torch
from espnet.nets.pytorch_backend.nets_utils import pad_list
DEFAULT_TIME_WARP_MODE = "bicubic"
def time_warp(x: torch.Tensor, window: int = 80, mode: str = DEFAULT_TIME_WARP_MODE):
"""Time warping using torch.interpolate.
Args:
x: (Batch, Time, Freq)
win... | 28.382022 | 85 | 0.557403 | import torch
from espnet.nets.pytorch_backend.nets_utils import pad_list
DEFAULT_TIME_WARP_MODE = "bicubic"
def time_warp(x: torch.Tensor, window: int = 80, mode: str = DEFAULT_TIME_WARP_MODE):
org_size = x.size()
if x.dim() == 3:
x = x[:, None]
t = x.shape[2]
if t - window <= ... | true | true |
1c14af9b028f1985819d685eef5798a5deb29ccd | 1,006 | py | Python | AminoLikeBo.py | LilZevi/AminoLikeBo | a31e02ea578b44b84754ffb63fcd179addd44a1b | [
"MIT"
] | 3 | 2021-02-20T08:29:54.000Z | 2021-07-31T14:16:22.000Z | AminoLikeBo.py | LilZevi/AminoLikeBo | a31e02ea578b44b84754ffb63fcd179addd44a1b | [
"MIT"
] | null | null | null | AminoLikeBo.py | LilZevi/AminoLikeBo | a31e02ea578b44b84754ffb63fcd179addd44a1b | [
"MIT"
] | 2 | 2021-04-26T23:44:29.000Z | 2021-06-26T12:06:28.000Z | import samino
import pyfiglet
import concurrent.futures
from colorama import init, Fore, Back, Style
init()
print(Fore.YELLOW + Style.NORMAL)
print("""Script by deluvsushi
Github : https://github.com/deluvsushi""")
print(pyfiglet.figlet_format("aminolikebo", font="big"))
client = samino.Client(None)
client.lo... | 35.928571 | 74 | 0.703777 | import samino
import pyfiglet
import concurrent.futures
from colorama import init, Fore, Back, Style
init()
print(Fore.YELLOW + Style.NORMAL)
print("""Script by deluvsushi
Github : https://github.com/deluvsushi""")
print(pyfiglet.figlet_format("aminolikebo", font="big"))
client = samino.Client(None)
client.lo... | true | true |
1c14afd4e0dc8e796439d9e47adbc89597bef44d | 5,110 | py | Python | src/generic_vault_secret/handlers.py | RenovoSolutions/cfn-renovo-vault-secrets | 824c762bd7ecad7defa59955921ff7e9bf10ba5f | [
"MIT"
] | null | null | null | src/generic_vault_secret/handlers.py | RenovoSolutions/cfn-renovo-vault-secrets | 824c762bd7ecad7defa59955921ff7e9bf10ba5f | [
"MIT"
] | 1 | 2021-06-30T19:22:56.000Z | 2021-06-30T19:24:36.000Z | src/generic_vault_secret/handlers.py | RenovoSolutions/cfn-renovo-vault-secrets | 824c762bd7ecad7defa59955921ff7e9bf10ba5f | [
"MIT"
] | null | null | null | import logging
from typing import Any, MutableMapping, Optional
from cloudformation_cli_python_lib import (
Action,
HandlerErrorCode,
OperationStatus,
ProgressEvent,
Resource,
SessionProxy,
exceptions,
identifier_utils,
)
from .models import ResourceHandlerRequest, ResourceModel
from ... | 34.066667 | 158 | 0.691585 | import logging
from typing import Any, MutableMapping, Optional
from cloudformation_cli_python_lib import (
Action,
HandlerErrorCode,
OperationStatus,
ProgressEvent,
Resource,
SessionProxy,
exceptions,
identifier_utils,
)
from .models import ResourceHandlerRequest, ResourceModel
from ... | true | true |
1c14b01699893af15c95d36878d94ede3b2b8cc7 | 49 | py | Python | prototype/test/pythonvm_book/test_if.py | zoloypzuo/ZeloPy | 43d9242a509737fe1bb66deba73aa9e749b53c62 | [
"MIT"
] | null | null | null | prototype/test/pythonvm_book/test_if.py | zoloypzuo/ZeloPy | 43d9242a509737fe1bb66deba73aa9e749b53c62 | [
"MIT"
] | null | null | null | prototype/test/pythonvm_book/test_if.py | zoloypzuo/ZeloPy | 43d9242a509737fe1bb66deba73aa9e749b53c62 | [
"MIT"
] | null | null | null | if 2 > 1:
print 2
else:
print 1
print 3
| 7 | 11 | 0.530612 | if 2 > 1:
print 2
else:
print 1
print 3
| false | true |
1c14b1e231d94b988ffeaef30a9ccec56844d6ca | 2,519 | py | Python | sdk/remoterendering/azure-mixedreality-remoterendering/azure/mixedreality/remoterendering/_generated/aio/_remote_rendering_rest_client_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/remoterendering/azure-mixedreality-remoterendering/azure/mixedreality/remoterendering/_generated/aio/_remote_rendering_rest_client_async.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/remoterendering/azure-mixedreality-remoterendering/azure/mixedreality/remoterendering/_generated/aio/_remote_rendering_rest_client_async.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.8 | 236 | 0.705042 |
from typing import Any
from azure.core import AsyncPipelineClient
from msrest import Deserializer, Serializer
from ._configuration_async import RemoteRenderingRestClientConfiguration
from .operations_async import RemoteRenderingOperations
from .. import models
class RemoteRenderingRestClient(object):
def __in... | true | true |
1c14b20d8cf0f9cbee96909c6420e448b8ed3406 | 10,032 | py | Python | tests/test_TimeCog.py | Khronus-Project/Khronus_TimeCog | 407d5e1a4bb2bdb81c5f6004f92777eec6ad4c89 | [
"MIT"
] | 2 | 2021-12-28T02:39:51.000Z | 2022-03-25T11:49:02.000Z | tests/test_TimeCog.py | Khronus-Project/Khronus_TimeCog | 407d5e1a4bb2bdb81c5f6004f92777eec6ad4c89 | [
"MIT"
] | null | null | null | tests/test_TimeCog.py | Khronus-Project/Khronus_TimeCog | 407d5e1a4bb2bdb81c5f6004f92777eec6ad4c89 | [
"MIT"
] | null | null | null | import pytest
from brownie import KhronusTimeCog_Test, accounts
from datetime import datetime, timezone
from dateutil.relativedelta import relativedelta
from random import randint
from utils import *
@pytest.fixture
def test_dates():
return generate_dates(1740,2200)
@pytest.fixture
def khronus_times():
time_c... | 48.463768 | 194 | 0.647329 | import pytest
from brownie import KhronusTimeCog_Test, accounts
from datetime import datetime, timezone
from dateutil.relativedelta import relativedelta
from random import randint
from utils import *
@pytest.fixture
def test_dates():
return generate_dates(1740,2200)
@pytest.fixture
def khronus_times():
time_c... | true | true |
1c14b3519398336740374ba0ba26f461fb03a2b6 | 14,760 | py | Python | ckan/controllers/admin.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | null | null | null | ckan/controllers/admin.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | null | null | null | ckan/controllers/admin.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | null | null | null | from ckan.lib.base import *
import ckan.authz
import ckan.lib.authztool
import ckan.model as model
from ckan.model.authz import Role
roles = Role.get_all()
role_tuples = [(x, x) for x in roles]
def get_sysadmins():
q = model.Session.query(model.SystemRole).filter_by(role=model.Role.ADMIN)
return [uor.user fo... | 46.125 | 79 | 0.506233 | from ckan.lib.base import *
import ckan.authz
import ckan.lib.authztool
import ckan.model as model
from ckan.model.authz import Role
roles = Role.get_all()
role_tuples = [(x, x) for x in roles]
def get_sysadmins():
q = model.Session.query(model.SystemRole).filter_by(role=model.Role.ADMIN)
return [uor.user fo... | false | true |
1c14b3a2533021e0e7177962aa58f9d8fec9724e | 3,177 | py | Python | src/train.py | thechuong98/Question-Answering | cdefaa70611dcb4d02b6ca4e2e810bd746451478 | [
"MIT"
] | null | null | null | src/train.py | thechuong98/Question-Answering | cdefaa70611dcb4d02b6ca4e2e810bd746451478 | [
"MIT"
] | null | null | null | src/train.py | thechuong98/Question-Answering | cdefaa70611dcb4d02b6ca4e2e810bd746451478 | [
"MIT"
] | null | null | null | # lightning imports
from pytorch_lightning import LightningModule, LightningDataModule, Callback, Trainer
from pytorch_lightning.loggers import LightningLoggerBase
from pytorch_lightning import seed_everything
# hydra imports
from omegaconf import DictConfig
from hydra.utils import log
import hydra
# normal imports
f... | 30.548077 | 85 | 0.689959 | from pytorch_lightning import LightningModule, LightningDataModule, Callback, Trainer
from pytorch_lightning.loggers import LightningLoggerBase
from pytorch_lightning import seed_everything
from omegaconf import DictConfig
from hydra.utils import log
import hydra
from typing import List, Optional
from src.utils impo... | true | true |
1c14b43f7be1cc15d41b235211e880e63c509334 | 6,891 | py | Python | code/validation/multiclass_predict_diseases.py | sanja7s/MedRed | 0d9bc5be603dbbab7807b01b00f15822e0a944c6 | [
"MIT"
] | null | null | null | code/validation/multiclass_predict_diseases.py | sanja7s/MedRed | 0d9bc5be603dbbab7807b01b00f15822e0a944c6 | [
"MIT"
] | null | null | null | code/validation/multiclass_predict_diseases.py | sanja7s/MedRed | 0d9bc5be603dbbab7807b01b00f15822e0a944c6 | [
"MIT"
] | null | null | null | # import spacy
from collections import defaultdict
# nlp = spacy.load('en_core_web_lg')
import pandas as pd
import seaborn as sns
import random
import pickle
import numpy as np
from xgboost import XGBClassifier
import matplotlib.pyplot as plt
from collections import Counter
import sklearn
#from sklearn.pipeline imp... | 29.075949 | 106 | 0.685967 | from collections import defaultdict
import pandas as pd
import seaborn as sns
import random
import pickle
import numpy as np
from xgboost import XGBClassifier
import matplotlib.pyplot as plt
from collections import Counter
import sklearn
from sklearn import linear_model
from sklearn.model_selection import KFold fr... | true | true |
1c14b4fca337401a516feb3f645bde308a407fca | 14,898 | py | Python | tools/accuracy_checker/openvino/tools/accuracy_checker/representation/segmentation_representation.py | TolyaTalamanov/open_model_zoo | 1697e60712df4ca72635a2080a197b9d3bc24129 | [
"Apache-2.0"
] | 1 | 2019-05-31T14:01:42.000Z | 2019-05-31T14:01:42.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/representation/segmentation_representation.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | null | null | null | tools/accuracy_checker/openvino/tools/accuracy_checker/representation/segmentation_representation.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2018-2022 Intel Corporation
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 wri... | 34.248276 | 119 | 0.64116 |
from enum import Enum
from pathlib import Path
from copy import deepcopy
from collections import defaultdict
import warnings
import cv2 as cv
import numpy as np
from .base_representation import BaseRepresentation
from ..data_readers import BaseReader
from ..utils import remove_difficult, UnsupportedPackage
try:
... | true | true |
1c14b5cac678448a2403d087cb1d6eabfa01ee78 | 29 | py | Python | dampp/src/__init__.py | s3h4n/DAMPP | 5b007c817d37bdc24e95683f8ee3533807f2f4a5 | [
"MIT"
] | 1 | 2022-02-12T14:06:29.000Z | 2022-02-12T14:06:29.000Z | dampp/src/__init__.py | s3h4n/DAMPP | 5b007c817d37bdc24e95683f8ee3533807f2f4a5 | [
"MIT"
] | null | null | null | dampp/src/__init__.py | s3h4n/DAMPP | 5b007c817d37bdc24e95683f8ee3533807f2f4a5 | [
"MIT"
] | null | null | null | from .handler import Handler
| 14.5 | 28 | 0.827586 | from .handler import Handler
| true | true |
1c14b614c85f38a5ac6f7e5a4b3c3669c93af26f | 1,218 | py | Python | unittest/python/test_ft_calibration.py | louise-scherrer/sot-talos-balance | e1d2c853439902955f15e30fa15c0ce4fd6811a0 | [
"BSD-2-Clause"
] | null | null | null | unittest/python/test_ft_calibration.py | louise-scherrer/sot-talos-balance | e1d2c853439902955f15e30fa15c0ce4fd6811a0 | [
"BSD-2-Clause"
] | null | null | null | unittest/python/test_ft_calibration.py | louise-scherrer/sot-talos-balance | e1d2c853439902955f15e30fa15c0ce4fd6811a0 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from numpy.testing import assert_almost_equal as assertApprox
import sot_talos_balance.talos.ft_calibration_conf as conf
from sot_talos_balance.ft_calibration import FtCalibration
robot_name = 'robot'
ftc = FtCalibration('ftc')
ftc.init(robot_name)
rfw = conf.rfw
lfw = conf.lfw
ftc.setLeftFootWeigh... | 33.833333 | 87 | 0.740558 | import numpy as np
from numpy.testing import assert_almost_equal as assertApprox
import sot_talos_balance.talos.ft_calibration_conf as conf
from sot_talos_balance.ft_calibration import FtCalibration
robot_name = 'robot'
ftc = FtCalibration('ftc')
ftc.init(robot_name)
rfw = conf.rfw
lfw = conf.lfw
ftc.setLeftFootWeigh... | true | true |
1c14b6cf25a43c1c8af9aa94b5243285b1576d68 | 3,707 | py | Python | old/gene.cluster.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | 3 | 2019-02-22T20:35:23.000Z | 2021-11-25T10:01:50.000Z | old/gene.cluster.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | null | null | null | old/gene.cluster.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | 1 | 2021-02-19T03:10:14.000Z | 2021-02-19T03:10:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import math
import os.path as op
import numpy as np
import argparse
orgs = """HM101
HM058 HM125 HM056 HM129 HM060
HM095 HM185 HM034 HM004 HM050
HM023 HM010 HM022 HM324 HM340
HM056.AC HM034.AC HM340.AC""".split()
dirw = "/home/youngn/zh... | 30.891667 | 151 | 0.541678 | import os
import sys
import math
import os.path as op
import numpy as np
import argparse
orgs = """HM101
HM058 HM125 HM056 HM129 HM060
HM095 HM185 HM034 HM004 HM050
HM023 HM010 HM022 HM324 HM340
HM056.AC HM034.AC HM340.AC""".split()
dirw = "/home/youngn/zhoup/Data/misc2/gene.cluster"
if not op.exists(... | false | true |
1c14b7537cdfc179a96a7a0c7f64d1e9c13de619 | 345 | py | Python | src/flask_platform/__init__.py | derekwu90/flask_platform | 10e9059f4bb0e691383ef21dcfe43095e3bed2f3 | [
"MIT"
] | null | null | null | src/flask_platform/__init__.py | derekwu90/flask_platform | 10e9059f4bb0e691383ef21dcfe43095e3bed2f3 | [
"MIT"
] | null | null | null | src/flask_platform/__init__.py | derekwu90/flask_platform | 10e9059f4bb0e691383ef21dcfe43095e3bed2f3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pkg_resources import get_distribution, DistributionNotFound
from flask_platform import views
try:
# Change here if project is renamed and does not equal the package name
dist_name = __name__
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
... | 21.5625 | 75 | 0.75942 | from pkg_resources import get_distribution, DistributionNotFound
from flask_platform import views
try:
dist_name = __name__
__version__ = get_distribution(dist_name).version
except DistributionNotFound:
__version__ = 'unknown'
| true | true |
1c14b7b6aa58efeb4e06cee481524c2c6f6f576b | 116,720 | py | Python | edb/pgsql/compiler/relgen.py | aaronbrighton/edgedb | 4aacd1d4e248ae0d483c075ba93fc462da291ef4 | [
"Apache-2.0"
] | null | null | null | edb/pgsql/compiler/relgen.py | aaronbrighton/edgedb | 4aacd1d4e248ae0d483c075ba93fc462da291ef4 | [
"Apache-2.0"
] | null | null | null | edb/pgsql/compiler/relgen.py | aaronbrighton/edgedb | 4aacd1d4e248ae0d483c075ba93fc462da291ef4 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 36.181029 | 79 | 0.582882 |
from __future__ import annotations
from typing import *
import contextlib
from edb import errors
from edb.edgeql import qltypes
from edb.schema import objects as s_obj
from edb.ir import ast as irast
from edb.ir import typeutils as irtyputils
from edb.ir import utils as irutils
from edb.pgsql import ast as pg... | true | true |
1c14b7d1dc86fc19ee1f397dc7f4ce9b72c9b93c | 7,413 | py | Python | manim/mobject/numbers.py | schlegelflegel/manim | 3e7bc9cc242e6d2da1c5346ad93fc9c964221bcb | [
"MIT"
] | null | null | null | manim/mobject/numbers.py | schlegelflegel/manim | 3e7bc9cc242e6d2da1c5346ad93fc9c964221bcb | [
"MIT"
] | null | null | null | manim/mobject/numbers.py | schlegelflegel/manim | 3e7bc9cc242e6d2da1c5346ad93fc9c964221bcb | [
"MIT"
] | null | null | null | __all__ = ["DecimalNumber", "Integer", "Variable"]
from ..constants import *
from ..mobject.svg.tex_mobject import MathTex, SingleStringMathTex, Tex
from ..mobject.svg.text_mobject import Text
from ..mobject.types.vectorized_mobject import VDict, VMobject
from ..mobject.value_tracker import ValueTracker
class Decim... | 34.319444 | 103 | 0.585188 | __all__ = ["DecimalNumber", "Integer", "Variable"]
from ..constants import *
from ..mobject.svg.tex_mobject import MathTex, SingleStringMathTex, Tex
from ..mobject.svg.text_mobject import Text
from ..mobject.types.vectorized_mobject import VDict, VMobject
from ..mobject.value_tracker import ValueTracker
class Decim... | true | true |
1c14ba7deaa6a3dadbdb0c4a2fa23d14474069e2 | 1,391 | py | Python | examples/range_based_execution.py | cameronwhite/doctest | d5aa2bfb8f00b6260296a754af3a3a98d93f7b67 | [
"MIT"
] | 3,789 | 2015-01-12T09:23:22.000Z | 2021-11-27T05:41:41.000Z | examples/range_based_execution.py | cameronwhite/doctest | d5aa2bfb8f00b6260296a754af3a3a98d93f7b67 | [
"MIT"
] | 523 | 2016-05-22T21:19:22.000Z | 2021-11-24T10:43:51.000Z | examples/range_based_execution.py | cameronwhite/doctest | d5aa2bfb8f00b6260296a754af3a3a98d93f7b67 | [
"MIT"
] | 552 | 2015-02-28T22:19:03.000Z | 2021-11-23T17:43:49.000Z | #!/usr/bin/python
import sys
import math
import multiprocessing
import subprocess
if len(sys.argv) < 2:
print("supply the path to the doctest executable as the first argument!")
sys.exit(1)
# get the number of tests in the doctest executable
num_tests = 0
program_with_args = [sys.argv[1], "--dt-count=1"]
fo... | 31.613636 | 91 | 0.673616 |
import sys
import math
import multiprocessing
import subprocess
if len(sys.argv) < 2:
print("supply the path to the doctest executable as the first argument!")
sys.exit(1)
num_tests = 0
program_with_args = [sys.argv[1], "--dt-count=1"]
for i in range(2, len(sys.argv)):
program_with_args.append(sys.argv[... | false | true |
1c14bac18d21171fd2718691a696243da9c289e4 | 1,331 | py | Python | setup.py | AceExpert/type-enforce-py | 228113bbda8067dd3e8117481d77d6e6fd9b3b63 | [
"Apache-2.0"
] | 2 | 2021-09-15T08:12:45.000Z | 2022-02-12T06:49:34.000Z | setup.py | AceExpert/type-enforce-py | 228113bbda8067dd3e8117481d77d6e6fd9b3b63 | [
"Apache-2.0"
] | null | null | null | setup.py | AceExpert/type-enforce-py | 228113bbda8067dd3e8117481d77d6e6fd9b3b63 | [
"Apache-2.0"
] | null | null | null | import setuptools
with open("./README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="type-enforce",
version="3.9.0",
author="Cybertron",
packages=['type_enforce'],
description="Supports enforcing type annotations on functions and coroutines. Complete su... | 38.028571 | 130 | 0.644628 | import setuptools
with open("./README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="type-enforce",
version="3.9.0",
author="Cybertron",
packages=['type_enforce'],
description="Supports enforcing type annotations on functions and coroutines. Complete su... | true | true |
1c14bb1b1c97fbe72d135947d79da7d697193bef | 1,058 | py | Python | bob/bio/base/test/dummy/preprocessor.py | bioidiap/bob.bio.base | 44b8d192e957eb328591c8110cf0113f602292ef | [
"BSD-3-Clause"
] | 16 | 2016-04-06T20:37:55.000Z | 2019-10-19T08:06:25.000Z | bob/bio/base/test/dummy/preprocessor.py | bioidiap/bob.bio.base | 44b8d192e957eb328591c8110cf0113f602292ef | [
"BSD-3-Clause"
] | 25 | 2015-07-04T17:41:40.000Z | 2016-08-08T20:36:01.000Z | bob/bio/base/test/dummy/preprocessor.py | bioidiap/bob.bio.base | 44b8d192e957eb328591c8110cf0113f602292ef | [
"BSD-3-Clause"
] | 7 | 2015-08-07T17:21:02.000Z | 2018-08-13T15:51:54.000Z | from bob.bio.base.preprocessor import Preprocessor
from bob.bio.base.database import BioFile
import numpy
numpy.random.seed(10)
class DummyPreprocessor (Preprocessor):
def __init__(self, return_none=False, probability_of_none=1, **kwargs):
Preprocessor.__init__(self)
self.return_none = return_none
self.... | 34.129032 | 104 | 0.768431 | from bob.bio.base.preprocessor import Preprocessor
from bob.bio.base.database import BioFile
import numpy
numpy.random.seed(10)
class DummyPreprocessor (Preprocessor):
def __init__(self, return_none=False, probability_of_none=1, **kwargs):
Preprocessor.__init__(self)
self.return_none = return_none
self.... | true | true |
1c14bb459841d5d6df443af4daac3ac5b90ec72e | 5,705 | py | Python | examples/django_example/dj/settings.py | cyroxx/python-social-auth | f6c0fa22524ef7c9ade4c5c323cf13ace86a247b | [
"BSD-3-Clause"
] | 1 | 2020-09-06T09:30:02.000Z | 2020-09-06T09:30:02.000Z | examples/django_example/dj/settings.py | cyroxx/python-social-auth | f6c0fa22524ef7c9ade4c5c323cf13ace86a247b | [
"BSD-3-Clause"
] | null | null | null | examples/django_example/dj/settings.py | cyroxx/python-social-auth | f6c0fa22524ef7c9ade4c5c323cf13ace86a247b | [
"BSD-3-Clause"
] | null | null | null | import sys
from os.path import abspath, dirname, join
sys.path.insert(0, '../..')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ROOT_PATH = abspath(dirname(__file__))
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',... | 30.672043 | 75 | 0.710605 | import sys
from os.path import abspath, dirname, join
sys.path.insert(0, '../..')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ROOT_PATH = abspath(dirname(__file__))
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db'
}
}
TIME_ZO... | true | true |
1c14bb53996f6ad4d58e4a9d6aaa4e445e9a4bfa | 6,963 | py | Python | chrome/test/pyautolib/chromoting_helper.py | shaochangbin/chromium-crosswalk | 634d34e4cf82b4f7400357c53ec12efaffe94add | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-16T03:57:28.000Z | 2021-01-23T15:29:45.000Z | chrome/test/pyautolib/chromoting_helper.py | shaochangbin/chromium-crosswalk | 634d34e4cf82b4f7400357c53ec12efaffe94add | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/test/pyautolib/chromoting_helper.py | shaochangbin/chromium-crosswalk | 634d34e4cf82b4f7400357c53ec12efaffe94add | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-03-15T13:21:38.000Z | 2017-03-15T13:21:38.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Chromoting helper to install/uninstall host and replace pref pane."""
import abc
import os
import shutil
import sys
import subprocess
class Chromot... | 34.641791 | 78 | 0.657475 |
import abc
import os
import shutil
import sys
import subprocess
class ChromotingHelper(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def InstallHost(self, bin_dir):
return
@abc.abstractmethod
def UninstallHost(self, bin_dir):
return
class ChromotingHelperMac(ChromotingHelper):
de... | true | true |
1c14bb9e1cfffac2bdf415be4f5bc91ead4b70d8 | 9,750 | py | Python | index_flask/extensions/user_app.py | lishnih/index_flask | 0e2f94a2a12f046f071f5b01c8792302582866ee | [
"MIT"
] | null | null | null | index_flask/extensions/user_app.py | lishnih/index_flask | 0e2f94a2a12f046f071f5b01c8792302582866ee | [
"MIT"
] | null | null | null | index_flask/extensions/user_app.py | lishnih/index_flask | 0e2f94a2a12f046f071f5b01c8792302582866ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Stan 2016-07-12
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import re
import hashlib
import random
from datetime import datetime
from flask import request, render_template, jsonify, redirect, url_for, flash
from j... | 29.36747 | 116 | 0.590564 |
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import re
import hashlib
import random
from datetime import datetime
from flask import request, render_template, jsonify, redirect, url_for, flash
from jinja2 import Markup, escape
from flask_login import lo... | true | true |
1c14bbe6c6f0f761021bcaa897a3d1b33de4321a | 2,619 | py | Python | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/notifier.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 347 | 2015-01-20T14:13:21.000Z | 2022-03-31T17:53:11.000Z | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/notifier.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 128 | 2015-05-22T19:14:32.000Z | 2022-03-31T08:11:18.000Z | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/notifier.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 202 | 2015-01-04T06:20:49.000Z | 2022-03-08T15:30:08.000Z | #
# ovirt-engine-setup -- ovirt engine setup
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
#
"""Notifier plugin."""
import gettext
from otopi import plugin
from otopi import util
from ovirt_engine import configfile
from ovirt_engine_setup.engine import constants as oenginecons
from ovirt_s... | 28.78022 | 79 | 0.576174 |
import gettext
from otopi import plugin
from otopi import util
from ovirt_engine import configfile
from ovirt_engine_setup.engine import constants as oenginecons
from ovirt_setup_lib import dialog
def _(m):
return gettext.dgettext(message=m, domain='ovirt-engine-setup')
@util.export
class Plugin(plugin.... | true | true |
1c14bc02ef3e17c09fb069eaa30ddec7969fd387 | 2,093 | py | Python | stac2odc/setup.py | M3nin0/bdc-odc | c2eaf803663ba27ea9cc927e4a112b318590919e | [
"MIT"
] | 3 | 2019-12-06T12:27:12.000Z | 2020-09-27T21:21:00.000Z | stac2odc/setup.py | M3nin0/bdc-odc | c2eaf803663ba27ea9cc927e4a112b318590919e | [
"MIT"
] | 14 | 2020-07-16T00:00:43.000Z | 2021-03-26T14:55:09.000Z | stac2odc/setup.py | M3nin0/bdc-odc | c2eaf803663ba27ea9cc927e4a112b318590919e | [
"MIT"
] | 4 | 2019-12-09T18:07:54.000Z | 2021-02-07T02:57:21.000Z | #
# This file is part of Repository of tools for the Brazil Data Cube Project.
# Copyright (C) 2020 INPE.
#
"""Brazil Data Cube stac2odc tool"""
import os
from setuptools import find_packages, setup
readme = open('README.rst').read()
history = open('CHANGES.rst').read()
docs_require = []
tests_require = []
extras... | 25.216867 | 86 | 0.624462 |
import os
from setuptools import find_packages, setup
readme = open('README.rst').read()
history = open('CHANGES.rst').read()
docs_require = []
tests_require = []
extras_require = {
}
extras_require['all'] = [req for exts, reqs in extras_require.items() for req in reqs]
setup_requires = [
'pytest-runner>=5.2... | true | true |
1c14bdf18bf51c6cfe11e0e3f1ff9f5257ab942d | 445 | py | Python | manage.py | JKimani77/News | 4ee2f54e1688d8b4f6be29e4923fa94b364fb0d6 | [
"MIT"
] | null | null | null | manage.py | JKimani77/News | 4ee2f54e1688d8b4f6be29e4923fa94b364fb0d6 | [
"MIT"
] | null | null | null | manage.py | JKimani77/News | 4ee2f54e1688d8b4f6be29e4923fa94b364fb0d6 | [
"MIT"
] | null | null | null | #from app import app
from app import create_main_app
from flask_script import Manager,Server
#Creating app instance
app = create_main_app('development')
manager = Manager(app)
manager.add_command('server',Server)
@manager.command
def test():
"""Run the unit tests."""
import unittest
tests = unittest.Test... | 22.25 | 51 | 0.737079 | from app import create_main_app
from flask_script import Manager,Server
app = create_main_app('development')
manager = Manager(app)
manager.add_command('server',Server)
@manager.command
def test():
import unittest
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(te... | true | true |
1c14be17ddf7218e828aa4c530f25c6d00ee4dbf | 1,039 | py | Python | monitoring/jupyterhub-db-probe/src/main.py | harshad16/odh-deployer | 5928e47f16f18e308037c070fd11db5af507faef | [
"Apache-2.0"
] | null | null | null | monitoring/jupyterhub-db-probe/src/main.py | harshad16/odh-deployer | 5928e47f16f18e308037c070fd11db5af507faef | [
"Apache-2.0"
] | null | null | null | monitoring/jupyterhub-db-probe/src/main.py | harshad16/odh-deployer | 5928e47f16f18e308037c070fd11db5af507faef | [
"Apache-2.0"
] | null | null | null | import os
import time
from prometheus_client import start_http_server, Gauge
from sqlalchemy import create_engine
DATABASE_RESPONSE_TIME = Gauge('jupyterhub_db_response_time', 'Time taken for Jupyterhub DB to respond. Negative values indicate failures')
def main():
user = os.getenv("JUPYTERHUB_DB_USER", "jupyter... | 29.685714 | 139 | 0.694899 | import os
import time
from prometheus_client import start_http_server, Gauge
from sqlalchemy import create_engine
DATABASE_RESPONSE_TIME = Gauge('jupyterhub_db_response_time', 'Time taken for Jupyterhub DB to respond. Negative values indicate failures')
def main():
user = os.getenv("JUPYTERHUB_DB_USER", "jupyter... | true | true |
1c14be6e298f4cd8b93c89bccfa5a6b6fd041420 | 2,685 | py | Python | app/mod_bucketlist/models.py | BrianLusina/bucketlist | 9894bfe78c5150ab5a7d5875e52d4eb8bedc2920 | [
"MIT"
] | null | null | null | app/mod_bucketlist/models.py | BrianLusina/bucketlist | 9894bfe78c5150ab5a7d5875e52d4eb8bedc2920 | [
"MIT"
] | 8 | 2019-08-27T14:57:19.000Z | 2021-02-08T03:37:20.000Z | app/mod_bucketlist/models.py | BrianLusina/bucketlist | 9894bfe78c5150ab5a7d5875e52d4eb8bedc2920 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, String, Integer, ForeignKey, Boolean
from app.models import Base
from app.mod_auth.models import UserAccount
from sqlalchemy.orm import relationship
import json
class BucketList(Base):
"""Maps to the bucketlists table """
__tablename__ = 'bucketlists'
name = Column(String(25... | 32.349398 | 93 | 0.634264 | from sqlalchemy import Column, String, Integer, ForeignKey, Boolean
from app.models import Base
from app.mod_auth.models import UserAccount
from sqlalchemy.orm import relationship
import json
class BucketList(Base):
__tablename__ = 'bucketlists'
name = Column(String(256), nullable=False)
created_by = Colu... | true | true |
1c14bf8c2bd3919aa198e9d9f4e10146999e636f | 5,534 | py | Python | scratch/activations/selu_standard_scaler.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 2 | 2021-07-26T10:56:33.000Z | 2021-12-20T17:30:53.000Z | scratch/activations/selu_standard_scaler.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-25T21:01:19.000Z | 2021-12-05T01:40:53.000Z | scratch/activations/selu_standard_scaler.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-27T02:35:10.000Z | 2021-11-27T02:35:10.000Z | import sys
sys.path.append("/home/luisals/DeepHalos")
from dlhalos_code import CNN
import tensorflow.keras.callbacks as callbacks
from tensorflow.keras.callbacks import CSVLogger
import tensorflow
from tensorflow.keras import regularizers
from tensorflow.keras.models import load_model
import dlhalos_code.data_processin... | 49.410714 | 119 | 0.601915 | import sys
sys.path.append("/home/luisals/DeepHalos")
from dlhalos_code import CNN
import tensorflow.keras.callbacks as callbacks
from tensorflow.keras.callbacks import CSVLogger
import tensorflow
from tensorflow.keras import regularizers
from tensorflow.keras.models import load_model
import dlhalos_code.data_processin... | true | true |
1c14bfa3eb475ddf4adba56aa2a86b8599efd2b7 | 2,153 | py | Python | tests/test_norm.py | fakufaku/doamm | 66c7124573fb2a2c705335f2f7e877378e585042 | [
"MIT"
] | 7 | 2021-06-10T00:05:03.000Z | 2022-01-25T20:48:28.000Z | tests/test_norm.py | santoshmore85/doamm | 66c7124573fb2a2c705335f2f7e877378e585042 | [
"MIT"
] | null | null | null | tests/test_norm.py | santoshmore85/doamm | 66c7124573fb2a2c705335f2f7e877378e585042 | [
"MIT"
] | 3 | 2021-06-14T09:20:15.000Z | 2022-03-23T05:22:28.000Z | import numpy as np
def extract_off_diagonal(X):
"""
Parameters
----------
X: array_like, shape (..., M, M)
A multi dimensional array
Returns
-------
Y: array_like, shape (..., M * (M - 1) / 2)
The linearized entries under the main diagonal
"""
# we need to format t... | 26.9125 | 86 | 0.56758 | import numpy as np
def extract_off_diagonal(X):
M = X.shape[-1]
assert X.shape[-2] == M
indices = np.arange(M)
mask = np.ravel_multi_index(np.where(indices[:, None] > indices[None, :]), (M, M))
print(indices[:, None] > indices[None, :])
print(mask)
return X.reshape(X.shape[:-2] + (X.s... | true | true |
1c14c01b84c62e84bc93acbbe4516f33e1b806c4 | 2,628 | py | Python | zvmsdk/log.py | jasealpers/python-zvm-sdk | feb19dd40915b1a6cad74e7ccda17bc76d015ea5 | [
"Apache-2.0"
] | 15 | 2019-08-14T20:15:17.000Z | 2020-09-28T01:09:48.000Z | zvmsdk/log.py | jasealpers/python-zvm-sdk | feb19dd40915b1a6cad74e7ccda17bc76d015ea5 | [
"Apache-2.0"
] | 179 | 2019-09-05T03:53:10.000Z | 2020-10-09T07:21:40.000Z | zvmsdk/log.py | jasealpers/python-zvm-sdk | feb19dd40915b1a6cad74e7ccda17bc76d015ea5 | [
"Apache-2.0"
] | 50 | 2019-06-14T16:51:53.000Z | 2020-08-27T05:36:38.000Z | # Copyright 2017,2018 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 30.206897 | 78 | 0.627854 |
import logging
import os
from zvmsdk import config
class Logger():
def __init__(self, logger):
self.logger = logging.getLogger(logger)
self.log_level = logging.INFO
def getlog(self):
return self.logger
def setup(self, log_dir, log_level, log_file_name='zvmsdk.log'):
... | true | true |
1c14c04313c0a3d1058a89045afc63bf3e539645 | 1,142 | py | Python | stocks/tools/proxy.py | pchaos/wanggeService | 839f7c6c52a685fcdc4b6a70cf8e9d6c8cc78255 | [
"MIT"
] | 11 | 2018-05-15T18:02:31.000Z | 2020-05-07T03:57:33.000Z | stocks/tools/proxy.py | pchaos/wanggeService | 839f7c6c52a685fcdc4b6a70cf8e9d6c8cc78255 | [
"MIT"
] | 1 | 2018-05-16T11:27:32.000Z | 2018-07-07T10:56:58.000Z | stocks/tools/proxy.py | pchaos/wanggeService | 839f7c6c52a685fcdc4b6a70cf8e9d6c8cc78255 | [
"MIT"
] | 13 | 2018-05-15T18:02:27.000Z | 2022-03-23T06:18:29.000Z | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
@File : proxy.py
Description :
@Author : pchaos
date: 18-6-13
-------------------------------------------------
Change Activity:
18-6-13:
@Contact : p19992003#gmail.com
-----------------... | 22.84 | 103 | 0.492119 | __author__ = 'pchaos'
import requests
PROXYSERVER = 'http://123.207.35.36'
def get_proxy(ip=PROXYSERVER, port=5010):
return requests.get("{}:{}/get/".format(ip, port)).content
def delete_proxy(proxy, ip=PROXYSERVER, port=5010):
requests.get("{}:{}/delete/?proxy={}".format(ip, port, proxy))
| true | true |
1c14c09657f0974f76616d87d6acdab2792597a6 | 3,066 | py | Python | cloud_functions/dailymail/examples.py | ClimateMisinformation/infrastructure | f0940b6f1814b302ff328d2f1d8a04ffa2acde64 | [
"Apache-2.0"
] | null | null | null | cloud_functions/dailymail/examples.py | ClimateMisinformation/infrastructure | f0940b6f1814b302ff328d2f1d8a04ffa2acde64 | [
"Apache-2.0"
] | null | null | null | cloud_functions/dailymail/examples.py | ClimateMisinformation/infrastructure | f0940b6f1814b302ff328d2f1d8a04ffa2acde64 | [
"Apache-2.0"
] | null | null | null | #
# 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 ... | 34.840909 | 154 | 0.685258 |
from scraper import Tool
from flask import Flask, request, escape
def scrapeurls(xrequest=request):
request_json = xrequest.get_json(silent=True)
request_args = xrequest.args
if request_json and 'url' in request_json:
search_url = request_json['url']
elif request_args and 'url' in request_... | true | true |
1c14c0e173aa72554cba0f20e7814b07f1689450 | 55,688 | py | Python | belphegor/gfl.py | nguuuquaaa/Belphegor | 50141b3a27b830578d1efe4322587cc11ae9dabe | [
"WTFPL"
] | 16 | 2018-05-30T15:54:50.000Z | 2020-06-28T01:15:15.000Z | belphegor/gfl.py | nguuuquaaa/Belphegor | 50141b3a27b830578d1efe4322587cc11ae9dabe | [
"WTFPL"
] | 1 | 2019-01-12T04:59:08.000Z | 2019-02-14T06:31:19.000Z | belphegor/gfl.py | nguuuquaaa/Belphegor | 50141b3a27b830578d1efe4322587cc11ae9dabe | [
"WTFPL"
] | 10 | 2017-10-24T20:30:35.000Z | 2021-06-20T09:50:02.000Z | import discord
from discord.ext import commands
from . import utils
from .utils import data_type, wiki, checks, config, modding, token
import json
from bs4 import BeautifulSoup as BS
import re
import json
import traceback
from urllib.parse import quote
import hashlib
#==================================================... | 36.977424 | 158 | 0.488831 | import discord
from discord.ext import commands
from . import utils
from .utils import data_type, wiki, checks, config, modding, token
import json
from bs4 import BeautifulSoup as BS
import re
import json
import traceback
from urllib.parse import quote
import hashlib
INF = float("inf")
GFWIKI_BASE = "https://iopwiki... | true | true |
1c14c2ca9a94f817c15ad8cbab04e335268e22f6 | 501 | py | Python | priorityQ.py | RafaelPedruzzi/IA-2019-2 | 7d99a8f02ec826403bd48c6eba574d802e558c36 | [
"MIT"
] | null | null | null | priorityQ.py | RafaelPedruzzi/IA-2019-2 | 7d99a8f02ec826403bd48c6eba574d802e558c36 | [
"MIT"
] | null | null | null | priorityQ.py | RafaelPedruzzi/IA-2019-2 | 7d99a8f02ec826403bd48c6eba574d802e558c36 | [
"MIT"
] | null | null | null | ## -------------------------------------------------------- ##
# Exercise 3: Branch and Bound
#
# Rafael Belmock Pedruzzi
#
# priorityQ.py: implements a simple priority queue
#
# Python version: 3.7.4
## -------------------------------------------------------- ##
import heapq
heap = []
def isEmpty():
if ... | 19.269231 | 62 | 0.469062 |
import heapq
heap = []
def isEmpty():
if len(heap) == 0:
return True
else:
return False
def insert(key,value):
heapq.heappush(heap, (key,value) )
def remove():
return (heapq.heappop(heap))[1]
| true | true |
1c14c409b8a3162349546e8cf0d766469bfd2238 | 15,989 | py | Python | tests/sharded_jit_test.py | srvasude/jax | fcb05915b5a106dbfad5162eb11064a9a5e430a2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-07T19:25:44.000Z | 2020-10-07T19:25:44.000Z | tests/sharded_jit_test.py | srvasude/jax | fcb05915b5a106dbfad5162eb11064a9a5e430a2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/sharded_jit_test.py | srvasude/jax | fcb05915b5a106dbfad5162eb11064a9a5e430a2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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, ... | 32.106426 | 82 | 0.644818 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from functools import partial
from unittest import SkipTest
import numpy as np
from absl.testing import absltest
from absl.testing import parameterized
import jax
from jax import jit, pmap, vjp
from jax impo... | true | true |
1c14c441d98d46a39788249d3130a26f91a642e9 | 3,111 | py | Python | nipype/interfaces/fsl/tests/test_auto_MELODIC.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_MELODIC.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_MELODIC.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..model import MELODIC
def test_MELODIC_inputs():
input_map = dict(ICs=dict(argstr='--ICs=%s',
),
approach=dict(argstr='-a %s',
),
args=dict(argstr='%s',
),
bg_image=dict(argstr='--bgimage=%s... | 23.044444 | 67 | 0.564449 | from __future__ import unicode_literals
from ..model import MELODIC
def test_MELODIC_inputs():
input_map = dict(ICs=dict(argstr='--ICs=%s',
),
approach=dict(argstr='-a %s',
),
args=dict(argstr='%s',
),
bg_image=dict(argstr='--bgimage=%s',
),
bg_threshold=dict(argstr='--bgthreshold=... | true | true |
1c14c4cd0a3de5e46637e09d460764a267b8c0de | 13,598 | py | Python | cifar/cifar.py | yanghr/Hoyer_MNIST | 2a50da067ba10f2fc783624f448fb5ca91914ff6 | [
"Apache-2.0"
] | 27 | 2020-01-21T22:02:25.000Z | 2022-01-18T23:16:28.000Z | cifar/cifar.py | yanghr/Hoyer_MNIST | 2a50da067ba10f2fc783624f448fb5ca91914ff6 | [
"Apache-2.0"
] | 3 | 2020-03-22T08:20:05.000Z | 2020-08-12T06:06:48.000Z | cifar/cifar.py | yanghr/Hoyer_MNIST | 2a50da067ba10f2fc783624f448fb5ca91914ff6 | [
"Apache-2.0"
] | 3 | 2020-05-28T16:12:30.000Z | 2022-02-19T03:01:38.000Z | '''
Training script for CIFAR-10/100
Copyright (c) Wei YANG, 2017
'''
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.... | 38.521246 | 176 | 0.615973 | '''
Training script for CIFAR-10/100
Copyright (c) Wei YANG, 2017
'''
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.... | false | true |
1c14c53d046ab2a9c74364cab6abd74f5d46ba1f | 1,601 | py | Python | The HackerRank Interview Preparation Kit/4 - Sorting/Merge Sort- Counting Inversions.py | sohammanjrekar/HackerRank | 1f5010133a1ac1e765e855a086053c97d9e958be | [
"MIT"
] | null | null | null | The HackerRank Interview Preparation Kit/4 - Sorting/Merge Sort- Counting Inversions.py | sohammanjrekar/HackerRank | 1f5010133a1ac1e765e855a086053c97d9e958be | [
"MIT"
] | null | null | null | The HackerRank Interview Preparation Kit/4 - Sorting/Merge Sort- Counting Inversions.py | sohammanjrekar/HackerRank | 1f5010133a1ac1e765e855a086053c97d9e958be | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'countInversions' function below.
#
# The function is expected to return a LONG_INTEGER.
# The function accepts INTEGER_ARRAY arr as parameter.
#
def countInversions(arr):
x = mergeSort(arr, 0, len(arr)-1)
... | 21.065789 | 58 | 0.55153 |
import math
import os
import random
import re
import sys
def countInversions(arr):
x = mergeSort(arr, 0, len(arr)-1)
return x
def merge(arr, left, middle, right):
if(arr[middle] <= arr[middle+1]):
return 0
count = 0
Left = arr[left:middle+1]
Right = arr[middle+1:ri... | true | true |
1c14c5e7930025a8ff3e121b1091f1bc342373aa | 1,474 | py | Python | powersimdata/scenario/delete.py | c-voegele/PowerSimData | 5b1500e573f00a34571316796ff442bfa753871a | [
"MIT"
] | null | null | null | powersimdata/scenario/delete.py | c-voegele/PowerSimData | 5b1500e573f00a34571316796ff442bfa753871a | [
"MIT"
] | null | null | null | powersimdata/scenario/delete.py | c-voegele/PowerSimData | 5b1500e573f00a34571316796ff442bfa753871a | [
"MIT"
] | null | null | null | from powersimdata.scenario.ready import Ready
from powersimdata.utility import server_setup
class Delete(Ready):
"""Deletes scenario."""
name = "delete"
allowed = []
exported_methods = {"delete_scenario"} | Ready.exported_methods
def delete_scenario(self, confirm=True):
"""Deletes scenar... | 29.48 | 67 | 0.619403 | from powersimdata.scenario.ready import Ready
from powersimdata.utility import server_setup
class Delete(Ready):
name = "delete"
allowed = []
exported_methods = {"delete_scenario"} | Ready.exported_methods
def delete_scenario(self, confirm=True):
scenario_id = self._scenario_info["id"]
... | true | true |
1c14c65b2e201665191a550cc2cce9b47a2d9762 | 51 | py | Python | ind2pack/__init__.py | GrishakV/lab17 | 6511a28074ee35e666e55ce56e188fd8128cf070 | [
"MIT"
] | null | null | null | ind2pack/__init__.py | GrishakV/lab17 | 6511a28074ee35e666e55ce56e188fd8128cf070 | [
"MIT"
] | null | null | null | ind2pack/__init__.py | GrishakV/lab17 | 6511a28074ee35e666e55ce56e188fd8128cf070 | [
"MIT"
] | null | null | null | from .ind2module import Goods
__all__ = ["Goods"]
| 12.75 | 29 | 0.72549 | from .ind2module import Goods
__all__ = ["Goods"]
| true | true |
1c14c6736f58549bcafa12fbf0ec4c52113a365e | 5,190 | py | Python | colour/models/rgb/transfer_functions/tests/test_viper_log.py | MaxSchambach/colour | 3f3685d616fda4be58cec20bc1e16194805d7e2d | [
"BSD-3-Clause"
] | null | null | null | colour/models/rgb/transfer_functions/tests/test_viper_log.py | MaxSchambach/colour | 3f3685d616fda4be58cec20bc1e16194805d7e2d | [
"BSD-3-Clause"
] | null | null | null | colour/models/rgb/transfer_functions/tests/test_viper_log.py | MaxSchambach/colour | 3f3685d616fda4be58cec20bc1e16194805d7e2d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.viper_log`
module.
"""
from __future__ import division, unicode_literals
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import (log_encoding_ViperLog,
... | 32.4375 | 78 | 0.657611 |
from __future__ import division, unicode_literals
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import (log_encoding_ViperLog,
log_decoding_ViperLog)
from colour.utilities import domain_range_scale, ignore_numpy_errors
__author__ = 'Co... | true | true |
1c14c6dd188ff88206e021b865e7236386fa575c | 24 | py | Python | python3/flags/__init__.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | 1 | 2021-03-06T16:38:28.000Z | 2021-03-06T16:38:28.000Z | python3/flags/__init__.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | null | null | null | python3/flags/__init__.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | null | null | null | from flags import flags
| 12 | 23 | 0.833333 | from flags import flags
| true | true |
1c14c6f775a5f492e31e9fcd2cb9bebdecad93d4 | 1,527 | py | Python | scrap/groupedViz.py | pihvi/edutime | c8f16e96b1c8b199dd1146c203084898040222b9 | [
"MIT"
] | null | null | null | scrap/groupedViz.py | pihvi/edutime | c8f16e96b1c8b199dd1146c203084898040222b9 | [
"MIT"
] | null | null | null | scrap/groupedViz.py | pihvi/edutime | c8f16e96b1c8b199dd1146c203084898040222b9 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
df = pd.read_csv('./data/sigite2014-difficulty-data.csv', sep=';')
def save_plot(title):
file = 'plots/' + title + '.png'
plt.savefig(file)
plt.clf()
plt.cla()
plt.close()
return file
max_weeks = 6
max_assigments = 200
wi... | 33.933333 | 111 | 0.535036 | import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
df = pd.read_csv('./data/sigite2014-difficulty-data.csv', sep=';')
def save_plot(title):
file = 'plots/' + title + '.png'
plt.savefig(file)
plt.clf()
plt.cla()
plt.close()
return file
max_weeks = 6
max_assigments = 200
wi... | true | true |
1c14c7a29d07ec16c741f05bd4a1c90b2e4a14da | 5,072 | py | Python | src/utils/commonscript.py | QProjectOrg/QRepo | 97846336540e2ab299b02f57f94ad343e5fe570d | [
"MIT"
] | null | null | null | src/utils/commonscript.py | QProjectOrg/QRepo | 97846336540e2ab299b02f57f94ad343e5fe570d | [
"MIT"
] | null | null | null | src/utils/commonscript.py | QProjectOrg/QRepo | 97846336540e2ab299b02f57f94ad343e5fe570d | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
import subprocess
import re
import os
import shutil
import configurer
import common
from src.utils.logger import log
def remove_dirs(dirs):
for path_dir in dirs:
if os.path.exists(path_dir):
shutil.rmtree(path_dir)
def remove_file(filepath):
os.remove(filepath)
... | 37.57037 | 106 | 0.581033 |
import subprocess
import re
import os
import shutil
import configurer
import common
from src.utils.logger import log
def remove_dirs(dirs):
for path_dir in dirs:
if os.path.exists(path_dir):
shutil.rmtree(path_dir)
def remove_file(filepath):
os.remove(filepath)
def check_russian(path):... | false | true |
1c14c7a70ec2e3ac359f3134715ed98349da2424 | 22,192 | py | Python | model/modeling/dbpn.py | giorgiovaccarino/CSSR | e62d936445abcd0e34844b93db6505e9a59bec04 | [
"MIT"
] | null | null | null | model/modeling/dbpn.py | giorgiovaccarino/CSSR | e62d936445abcd0e34844b93db6505e9a59bec04 | [
"MIT"
] | null | null | null | model/modeling/dbpn.py | giorgiovaccarino/CSSR | e62d936445abcd0e34844b93db6505e9a59bec04 | [
"MIT"
] | null | null | null | import os
import torch.nn as nn
from .base_networks import *
from torchvision.transforms import *
class Net_2(nn.Module):
def __init__(self, scale_factor, num_channels=3, base_filter=64, feat=256):
super(Net_2, self).__init__()
num_stages = 2
if scale_factor == 2:
kernel =... | 36.143322 | 115 | 0.561869 | import os
import torch.nn as nn
from .base_networks import *
from torchvision.transforms import *
class Net_2(nn.Module):
def __init__(self, scale_factor, num_channels=3, base_filter=64, feat=256):
super(Net_2, self).__init__()
num_stages = 2
if scale_factor == 2:
kernel =... | true | true |
1c14c7aae2e4d52c39aab6c24e850caceb31749e | 8,225 | py | Python | JQTT/Subscriber.py | Jaimeloeuf/JQTT | 8ac5a4332610f5b93c98af121f6467f655548893 | [
"MIT"
] | 1 | 2019-02-18T02:30:13.000Z | 2019-02-18T02:30:13.000Z | JQTT/Subscriber.py | Jaimeloeuf/JQTT | 8ac5a4332610f5b93c98af121f6467f655548893 | [
"MIT"
] | null | null | null | JQTT/Subscriber.py | Jaimeloeuf/JQTT | 8ac5a4332610f5b93c98af121f6467f655548893 | [
"MIT"
] | null | null | null | """ Dependencies """
import paho.mqtt.client as mqtt
from Jevents import Watch
# Default function to run on disconnect from the Broker
def disconnected(self, user_data, rc):
""" The value of 'rc' determines success or not:
0: Connection successful
1: Connection refused - incorrect protocol version... | 42.396907 | 154 | 0.68 | import paho.mqtt.client as mqtt
from Jevents import Watch
def disconnected(self, user_data, rc):
print('Disconnected from MQTT broker')
def print_msg(message):
print(message.payload.decode())
def connected(self, user_data, flags_dict, rc):
print(f'Client successfully connected to the Broker "{... | true | true |
1c14c8417e070ff5830f59fcb947307b2cac5fde | 1,374 | py | Python | src/pipelines/vaccinations/bo_finmango.py | pbattaglia/covid-19-open-data | 876583671f160838c312574a847c1f37d68ef546 | [
"Apache-2.0"
] | 1 | 2021-03-31T02:07:30.000Z | 2021-03-31T02:07:30.000Z | src/pipelines/vaccinations/bo_finmango.py | a27cheung/covid-19-open-data | 5bcba7f9253465ad817e073fab996fc9e6d97b38 | [
"Apache-2.0"
] | 1 | 2021-02-18T02:13:02.000Z | 2021-02-18T02:13:02.000Z | src/pipelines/vaccinations/bo_finmango.py | a27cheung/covid-19-open-data | 5bcba7f9253465ad817e073fab996fc9e6d97b38 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.512195 | 87 | 0.73508 |
from typing import Any, Dict
from pandas import DataFrame
from lib.cast import safe_int_cast
from lib.data_source import DataSource
from lib.utils import table_rename
from pipelines.epidemiology.de_authority import _SUBREGION1_CODE_MAP
_column_adapter = {
"Date": "date",
"Department": "match_string",
"Fi... | true | true |
1c14c9920f7ee84b293a40d7dcb33eee819442d5 | 6,348 | py | Python | retinaFace/detect_video.py | factzero/pytorch_jaguarface_examples | f248ff8899b8fe9d41a1e8ac095ed5b6688987ed | [
"MIT"
] | 2 | 2020-04-09T05:48:35.000Z | 2020-05-05T03:22:20.000Z | retinaFace/detect_video.py | factzero/pytorch_jaguarface_examples | f248ff8899b8fe9d41a1e8ac095ed5b6688987ed | [
"MIT"
] | 1 | 2020-04-09T05:49:49.000Z | 2020-04-09T05:49:49.000Z | retinaFace/detect_video.py | factzero/pytorch_jaguarface_examples | f248ff8899b8fe9d41a1e8ac095ed5b6688987ed | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import argparse
import cv2
import numpy as np
import time
import torch
from core.config import cfg_mnet
from core.retinaface import RetinaFace
from utils.prior_box import PriorBox
from utils.box_utils import decode, decode_landm, nms
parser = argparse.ArgumentParser(description='Retinaface')
p... | 39.924528 | 109 | 0.628387 | import argparse
import cv2
import numpy as np
import time
import torch
from core.config import cfg_mnet
from core.retinaface import RetinaFace
from utils.prior_box import PriorBox
from utils.box_utils import decode, decode_landm, nms
parser = argparse.ArgumentParser(description='Retinaface')
parser.add_argument('--tr... | true | true |
1c14cac66654bcb85922ab65e057c2c113cc2fde | 926 | py | Python | refactor/old/tests/unittesting/core/helpers/test_display_apitest_object_summary.py | luissaiz/apicheck | 316971450ad226247e64e7ba7c95511e38d420c9 | [
"Apache-2.0"
] | 2 | 2019-05-31T09:56:59.000Z | 2019-05-31T11:28:50.000Z | refactor/old/tests/unittesting/core/helpers/test_display_apitest_object_summary.py | harry1080/apicheck | d38bd40711102b6f8e542c1a59786c25a6dc11ef | [
"Apache-2.0"
] | null | null | null | refactor/old/tests/unittesting/core/helpers/test_display_apitest_object_summary.py | harry1080/apicheck | d38bd40711102b6f8e542c1a59786c25a6dc11ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 BBVA
#
# 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, softwar... | 37.04 | 92 | 0.802376 | from apitest.core.helpers import display_apitest_object_summary
def test_display_apitest_object_summary_runs_ok(apitest_obj):
assert display_apitest_object_summary(apitest_obj) is None
def test_display_apitest_object_summary_custom_function(apitest_obj):
assert display_apitest_object_summary(apitest_obj, ... | true | true |
1c14caf602dad9f29de5048a411e1d5913d5d315 | 18,661 | py | Python | scripts/linters/general_purpose_linter_test.py | lheureuxe13/oppia | 7110e3e5d5a53527c31d7b33e14d25e8d5b981f9 | [
"Apache-2.0"
] | 3 | 2019-04-20T18:22:06.000Z | 2019-05-16T00:44:05.000Z | scripts/linters/general_purpose_linter_test.py | lheureuxe13/oppia | 7110e3e5d5a53527c31d7b33e14d25e8d5b981f9 | [
"Apache-2.0"
] | 40 | 2020-06-09T08:55:40.000Z | 2021-08-11T22:10:14.000Z | scripts/linters/general_purpose_linter_test.py | lheureuxe13/oppia | 7110e3e5d5a53527c31d7b33e14d25e8d5b981f9 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | 44.966265 | 80 | 0.705268 |
from __future__ import absolute_import
from __future__ import unicode_literals
import multiprocessing
import os
from core.tests import test_utils
from . import general_purpose_linter
from . import pre_commit_linter
from . import warranted_angular_security_bypasses
NAME_SPACE = multiprocessing.Manager().Namespace... | true | true |
1c14cc0104a6840ff4c137f575e8374b467772a1 | 853 | py | Python | clients/python-fastapi/generated/src/openapi_server/apis/ability_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-fastapi/generated/src/openapi_server/apis/ability_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-fastapi/generated/src/openapi_server/apis/ability_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | # coding: utf-8
from typing import Dict, List # noqa: F401
from fastapi import ( # noqa: F401
APIRouter,
Body,
Cookie,
Depends,
Form,
Header,
Path,
Query,
Response,
Security,
status,
)
from openapi_server.models.extra_models import TokenModel # noqa: F401
router = API... | 17.06 | 71 | 0.579132 |
from typing import Dict, List
from fastapi import ( APIRouter,
Body,
Cookie,
Depends,
Form,
Header,
Path,
Query,
Response,
Security,
status,
)
from openapi_server.models.extra_models import TokenModel
router = APIRouter()
@router.get(
"/api/v2/ability/",
res... | true | true |
1c14cc6c94cc78cda37d7dc68a74e142d6bec2ff | 1,684 | py | Python | paramgen/paramgen.py | ldbc/ldbc_snb_bi | 778a075bebe81830a6f6dfe1bb39ad2b73efc87c | [
"Apache-2.0"
] | 4 | 2021-07-02T18:43:43.000Z | 2022-03-13T21:46:44.000Z | paramgen/paramgen.py | ldbc/ldbc_snb_bi | 778a075bebe81830a6f6dfe1bb39ad2b73efc87c | [
"Apache-2.0"
] | 36 | 2021-05-30T02:35:22.000Z | 2022-03-20T21:14:56.000Z | paramgen/paramgen.py | ldbc/ldbc_snb_bi | 778a075bebe81830a6f6dfe1bb39ad2b73efc87c | [
"Apache-2.0"
] | 4 | 2021-12-25T00:39:31.000Z | 2022-03-24T20:00:45.000Z | import os
import duckdb
csv_path = "factors/"
con = duckdb.connect(database='factors.duckdb')
print("============ Initializing database ============")
with open(f"parameter-queries/ddl/schema.sql", "r") as schema_file:
con.execute(schema_file.read())
print()
print("============ Loading the factor tables ========... | 58.068966 | 392 | 0.63658 | import os
import duckdb
csv_path = "factors/"
con = duckdb.connect(database='factors.duckdb')
print("============ Initializing database ============")
with open(f"parameter-queries/ddl/schema.sql", "r") as schema_file:
con.execute(schema_file.read())
print()
print("============ Loading the factor tables ========... | true | true |
1c14cd6b8dd40fc39659e9b9465b01bc26990325 | 4,710 | py | Python | src/falconpy/zero_trust_assessment.py | CrowdStrike/falconpy | e7245202224647a2c8d134e72f27d2f6c667a1ce | [
"Unlicense"
] | 111 | 2020-11-19T00:44:18.000Z | 2022-03-03T21:02:32.000Z | src/falconpy/zero_trust_assessment.py | CrowdStrike/falconpy | e7245202224647a2c8d134e72f27d2f6c667a1ce | [
"Unlicense"
] | 227 | 2020-12-05T03:02:27.000Z | 2022-03-22T14:12:42.000Z | src/falconpy/zero_trust_assessment.py | CrowdStrike/falconpy | e7245202224647a2c8d134e72f27d2f6c667a1ce | [
"Unlicense"
] | 47 | 2020-11-23T21:00:14.000Z | 2022-03-28T18:30:19.000Z | """Falcon Zero Trust Assessment API Interface Class
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|... | 42.818182 | 109 | 0.687898 | from ._util import force_default, process_service_request, handle_single_argument
from ._service_class import ServiceClass
from ._endpoint._zero_trust_assessment import _zero_trust_assessment_endpoints as Endpoints
class ZeroTrustAssessment(ServiceClass):
@force_default(defaults=["parameters"], default_types=["di... | true | true |
1c14cdece9ec0cabaad62364c5b0464d7a8d025b | 203 | py | Python | python/books/hard_way/p3/ex12.py | ShenJinXiang/example | 9d3bdf73079092791d3f96d73573ee51d66774ab | [
"MIT"
] | null | null | null | python/books/hard_way/p3/ex12.py | ShenJinXiang/example | 9d3bdf73079092791d3f96d73573ee51d66774ab | [
"MIT"
] | null | null | null | python/books/hard_way/p3/ex12.py | ShenJinXiang/example | 9d3bdf73079092791d3f96d73573ee51d66774ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
age = input("How old are you? ")
height = input("How tall are you? ")
weight = input("How much do you weigh? ")
print(f"So, you're {age} old, {height} tall and {weight} heavy.") | 25.375 | 65 | 0.64532 |
age = input("How old are you? ")
height = input("How tall are you? ")
weight = input("How much do you weigh? ")
print(f"So, you're {age} old, {height} tall and {weight} heavy.") | true | true |
1c14ce578c16fc38c4f0cb5483f1f4fddf74b401 | 2,530 | py | Python | homeassistant/components/etherscan/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/components/etherscan/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/components/etherscan/sensor.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Support for Etherscan sensors."""
from datetime import timedelta
from pyetherscan import get_balance
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_ADDRESS, CONF_NAME, CONF_TOKEN
import homeassistant.helpers.config_validat... | 29.418605 | 85 | 0.677075 | from datetime import timedelta
from pyetherscan import get_balance
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_ADDRESS, CONF_NAME, CONF_TOKEN
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.... | true | true |
1c14ce7b76fa60b3dc062dce4b39f99658ac9ab2 | 179 | py | Python | testdraft.py | Thanhson89/fpsyn | 6a7fd0a233e306bb3f503cf84274d33667953cf7 | [
"MIT"
] | null | null | null | testdraft.py | Thanhson89/fpsyn | 6a7fd0a233e306bb3f503cf84274d33667953cf7 | [
"MIT"
] | null | null | null | testdraft.py | Thanhson89/fpsyn | 6a7fd0a233e306bb3f503cf84274d33667953cf7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import FPSynDivLib as FPSDiv
asg =FPSDiv.diverr('t187','t158','t186','temp97','temp131',2**(-53)) | 17.9 | 68 | 0.648045 |
import FPSynDivLib as FPSDiv
asg =FPSDiv.diverr('t187','t158','t186','temp97','temp131',2**(-53)) | true | true |
1c14ceddc572e40fe5366a26e697dd65aaa159e0 | 3,511 | py | Python | L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
import os
simGmtCaloSumDigis = cms.EDProducer('L1TMuonCaloSumProducer',
caloStage2Layer2Label = cms.InputTag("simCaloStage2Layer1Digis"),
)
simGmtStage2Digis = cms.EDProducer('L1TMuonProducer',
barrelTFInput = cms.InputTag("simKBmtfDigis", "BMTF"),
overlapTFInput... | 53.19697 | 171 | 0.638849 | import FWCore.ParameterSet.Config as cms
import os
simGmtCaloSumDigis = cms.EDProducer('L1TMuonCaloSumProducer',
caloStage2Layer2Label = cms.InputTag("simCaloStage2Layer1Digis"),
)
simGmtStage2Digis = cms.EDProducer('L1TMuonProducer',
barrelTFInput = cms.InputTag("simKBmtfDigis", "BMTF"),
overlapTFInput... | true | true |
1c14cf659ad24e5df326fc8f94642d587a14a4c6 | 817 | py | Python | twitter_stream.py | xwshiba/twitter-sentiment-analysis | 8e42c7c9f3156afe9d1e9a985c5ada17c1fe8566 | [
"MIT"
] | null | null | null | twitter_stream.py | xwshiba/twitter-sentiment-analysis | 8e42c7c9f3156afe9d1e9a985c5ada17c1fe8566 | [
"MIT"
] | null | null | null | twitter_stream.py | xwshiba/twitter-sentiment-analysis | 8e42c7c9f3156afe9d1e9a985c5ada17c1fe8566 | [
"MIT"
] | null | null | null | from TwitterAPI import TwitterAPI # https://github.com/geduldig/TwitterAPI
import json
# Your access information goes here
CONSUMER_KEY = "<YOUR TOKEN HERE>"
CONSUMER_SECRET = "<YOUR TOKEN HERE>"
ACCESS_TOKEN_KEY = "<YOUR TOKEN HERE>"
ACCESS_TOKEN_SECRET = "<YOUR TOKEN HERE>"
api = TwitterAPI(CONSUMER_KEY, CONSUMER_... | 28.172414 | 75 | 0.69645 | from TwitterAPI import TwitterAPI import json
CONSUMER_KEY = "<YOUR TOKEN HERE>"
CONSUMER_SECRET = "<YOUR TOKEN HERE>"
ACCESS_TOKEN_KEY = "<YOUR TOKEN HERE>"
ACCESS_TOKEN_SECRET = "<YOUR TOKEN HERE>"
api = TwitterAPI(CONSUMER_KEY, CONSUMER_SECRET,
ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET)
SEARCH_TERM ... | true | true |
1c14cfef2abf6c32d7c1c46c4d4f3f4d60c72fad | 1,393 | py | Python | third_party/android_deps/libs/com_google_errorprone_error_prone_check_api/3pp/fetch.py | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-10-18T02:33:40.000Z | 2020-10-18T02:33:40.000Z | third_party/android_deps/libs/com_google_errorprone_error_prone_check_api/3pp/fetch.py | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 3 | 2021-05-17T16:28:52.000Z | 2021-05-21T22:42:22.000Z | third_party/android_deps/libs/com_google_errorprone_error_prone_check_api/3pp/fetch.py | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is generated, do not edit. Update BuildConfigGenerator.groovy and
# 3ppFetch.template instead.
from __future__ import print_fun... | 24.438596 | 132 | 0.688442 |
from __future__ import print_function
import argparse
import json
import os
_FILE_URL = 'https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_check_api/2.7.1/error_prone_check_api-2.7.1.jar'
_FILE_NAME = 'error_prone_check_api-2.7.1.jar'
_FILE_VERSION = '2.7.1'
def do_latest():
print(_FILE_V... | true | true |
1c14d07f2a4e9845cd96553be56b5004828f17b5 | 14,229 | py | Python | .history/src/Simulador_20200712150639.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200712150639.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200712150639.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix, lil_matrix
class S... | 38.983562 | 159 | 0.655281 | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix, lil_matrix
class S... | true | true |
1c14d0f9e896fe38f326a6fec4a62133ac55f406 | 844 | py | Python | var/spack/repos/builtin/packages/r-prettydoc/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-prettydoc/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/r-prettydoc/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RPrettydoc(RPackage):
"""Creating Pretty Documents from R Markdown.
Creating ... | 36.695652 | 95 | 0.748815 |
from spack.package import *
class RPrettydoc(RPackage):
cran = "prettydoc"
version('0.4.1', sha256='1094a69b026238d149435472b4f41c75151c7370a1be6c6332147c88ad4c4829')
depends_on('r-rmarkdown@1.17:', type=('build', 'run'))
depends_on('pandoc@1.12.3:', type='build')
| true | true |
1c14d23031b133b800d93d3870bcdee48dec2018 | 12,041 | py | Python | snippets/Python/edgegrowing.py | JLLeitschuh/TIPL | 89c5d82932f89a2b4064d5d86ac83045ce9bc7d5 | [
"Apache-2.0"
] | 1 | 2019-11-22T11:02:52.000Z | 2019-11-22T11:02:52.000Z | snippets/Python/edgegrowing.py | JLLeitschuh/TIPL | 89c5d82932f89a2b4064d5d86ac83045ce9bc7d5 | [
"Apache-2.0"
] | 4 | 2019-11-21T14:13:32.000Z | 2020-02-11T15:15:23.000Z | snippets/Python/edgegrowing.py | JLLeitschuh/TIPL | 89c5d82932f89a2b4064d5d86ac83045ce9bc7d5 | [
"Apache-2.0"
] | 1 | 2020-02-11T06:19:45.000Z | 2020-02-11T06:19:45.000Z | """ A script which implements the : try to segment the pores using a region growing
/ k-means clustering - like algorithm where neighboring pores which have similar
enough (a threshold value) orientations are grouped together.
That might make the data easier to visualize and ideally the layers we sometimes see will... | 38.717042 | 131 | 0.607923 | import tracktools as tt
import os, sys
import numpy as np
keys2dict = lambda keys, defaultVal=[]: dict(map(lambda x: (x, defaultVal), keys))
fullset = lambda inlist: np.unique(
map(lambda x: x[0], inlist) + map(lambda x: x[1], inlist)
)
def run(
objFile,
edgeFile,
objVars=["PCA3_X", "PCA3_Y", "PCA3_... | true | true |
1c14d3c28710e63c801b4c807e6d85b6690154b5 | 8,863 | py | Python | cogdl/models/emb/hin2vec.py | cenyk1230/cogdl | fa1f74d5c3a15b5a52abfc7cd3f04dce4b7dbcce | [
"MIT"
] | 2 | 2021-06-25T08:18:36.000Z | 2021-06-25T08:51:00.000Z | cogdl/models/emb/hin2vec.py | cenyk1230/cogdl | fa1f74d5c3a15b5a52abfc7cd3f04dce4b7dbcce | [
"MIT"
] | null | null | null | cogdl/models/emb/hin2vec.py | cenyk1230/cogdl | fa1f74d5c3a15b5a52abfc7cd3f04dce4b7dbcce | [
"MIT"
] | null | null | null | import hashlib
import networkx as nx
import numpy as np
import random
from .. import BaseModel, register_model
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from tqdm import tqdm
class Hin2vec_layer(nn.Module):
def __init__(self, num_node, num_relatio... | 40.286364 | 131 | 0.571364 | import hashlib
import networkx as nx
import numpy as np
import random
from .. import BaseModel, register_model
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from tqdm import tqdm
class Hin2vec_layer(nn.Module):
def __init__(self, num_node, num_relatio... | true | true |
1c14d49276aa3503925eb8a781b6c5fa0e6589b2 | 468 | py | Python | tollan/utils/tests/test_dict_from_regex_match.py | toltec-astro/tollan | 36a78224ceef4145be1c5acca734b5c317eb7ba8 | [
"BSD-3-Clause"
] | null | null | null | tollan/utils/tests/test_dict_from_regex_match.py | toltec-astro/tollan | 36a78224ceef4145be1c5acca734b5c317eb7ba8 | [
"BSD-3-Clause"
] | null | null | null | tollan/utils/tests/test_dict_from_regex_match.py | toltec-astro/tollan | 36a78224ceef4145be1c5acca734b5c317eb7ba8 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
from ..misc import dict_from_regex_match
def test_dict_from_regex_match():
pattern = r'(?P<key1>\d+)_(?P<key2>\w+)?'
assert dict_from_regex_match(pattern, '01_abc') == {
'key1': '01',
'key2': 'abc'
}
assert dict_from_regex_match(pattern, '01_abc... | 23.4 | 69 | 0.510684 |
from ..misc import dict_from_regex_match
def test_dict_from_regex_match():
pattern = r'(?P<key1>\d+)_(?P<key2>\w+)?'
assert dict_from_regex_match(pattern, '01_abc') == {
'key1': '01',
'key2': 'abc'
}
assert dict_from_regex_match(pattern, '01_abc', type_dispatcher={
... | true | true |
1c14d54a80880e1618a43a0d99555227900f54cb | 8,082 | py | Python | enaml/qt/qt_dock_item.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 1,080 | 2015-01-04T14:29:34.000Z | 2022-03-29T05:44:51.000Z | enaml/qt/qt_dock_item.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 308 | 2015-01-05T22:44:13.000Z | 2022-03-30T21:19:18.000Z | enaml/qt/qt_dock_item.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 123 | 2015-01-25T16:33:48.000Z | 2022-02-25T19:57:10.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013-2017, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------... | 31.694118 | 79 | 0.533408 | from atom.api import Int, Typed, atomref
from enaml.styling import StyleCache
from enaml.widgets.close_event import CloseEvent
from enaml.widgets.dock_item import ProxyDockItem
from .QtCore import Qt, QSize, Signal
from .QtGui import QIcon
from .docking.q_dock_item import QDockItem
from .q_resource_helpers import g... | true | true |
1c14d60d67dafb284283a3333d073d6f98791ba7 | 2,447 | py | Python | clouds/models/clf_models.py | jchen42703/understanding-clouds-kaggle | 6972deb25cdf363ae0d9a9ad26d538280613fc94 | [
"Apache-2.0"
] | 1 | 2019-10-26T16:33:40.000Z | 2019-10-26T16:33:40.000Z | clouds/models/clf_models.py | jchen42703/understanding-clouds-kaggle | 6972deb25cdf363ae0d9a9ad26d538280613fc94 | [
"Apache-2.0"
] | 1 | 2019-11-08T02:50:25.000Z | 2019-11-19T03:36:54.000Z | clouds/models/clf_models.py | jchen42703/understanding-clouds-kaggle | 6972deb25cdf363ae0d9a9ad26d538280613fc94 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
import torch
import pretrainedmodels
class Pretrained(nn.Module):
"""
A generalized class for fetching a pretrained model from Cadene/pretrainedmodels
From: https://github.com/catalyst-team/mlcomp/blob/master/mlcomp/contrib/model/pretrained.py
"""
def __init__(self, variant, ... | 33.520548 | 96 | 0.557417 | import torch.nn as nn
import torch
import pretrainedmodels
class Pretrained(nn.Module):
def __init__(self, variant, num_classes, pretrained=True, activation=None):
super().__init__()
params = {'num_classes': 1000}
if not pretrained:
params['pretrained'] = None
model = p... | true | true |
1c14d71941933d30f8e0841afbdbab2272d28b55 | 7,599 | py | Python | code/Test/ID2TAttackTest.py | thrimbor/ID2T | bcf7b3aa302acef02c724ef422d7d16707971fdf | [
"MIT"
] | 1 | 2022-02-15T06:41:35.000Z | 2022-02-15T06:41:35.000Z | code/Test/ID2TAttackTest.py | thrimbor/ID2T | bcf7b3aa302acef02c724ef422d7d16707971fdf | [
"MIT"
] | 24 | 2018-11-08T16:33:06.000Z | 2018-11-08T16:36:02.000Z | code/Test/ID2TAttackTest.py | Trace-Share/ID2T | ada96c6ba06bc1e52516ada7f7447eb3ea2791c7 | [
"MIT"
] | null | null | null | import inspect
import unittest
import scapy.utils as pcr
import Core.Controller as Ctrl
import ID2TLib.TestLibrary as Lib
class ID2TAttackTest(unittest.TestCase):
"""
Generic Test Class for Core attacks based on unittest.TestCase.
"""
def checksum_test(self, attack_args, sha256_checksum, seed=5, cl... | 48.401274 | 118 | 0.651533 | import inspect
import unittest
import scapy.utils as pcr
import Core.Controller as Ctrl
import ID2TLib.TestLibrary as Lib
class ID2TAttackTest(unittest.TestCase):
def checksum_test(self, attack_args, sha256_checksum, seed=5, cleanup=True, pcap=Lib.test_pcap,
flag_write_file=False, flag_re... | true | true |
1c14d7b62c54ff7f318cb32be04ad192b54387d9 | 5,035 | py | Python | source/code/helpers/__init__.py | eshack94/aws-ops-automator | 92e2419c133d79962cca4dc2ec473c6c1e2f1c66 | [
"MIT"
] | 1 | 2019-08-25T18:59:06.000Z | 2019-08-25T18:59:06.000Z | source/code/helpers/__init__.py | eshack94/aws-ops-automator | 92e2419c133d79962cca4dc2ec473c6c1e2f1c66 | [
"MIT"
] | null | null | null | source/code/helpers/__init__.py | eshack94/aws-ops-automator | 92e2419c133d79962cca4dc2ec473c6c1e2f1c66 | [
"MIT"
] | null | null | null | ######################################################################################################################
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 36.223022 | 123 | 0.517776 | import collections
import decimal
import json
import sys
import traceback
import types
from datetime import datetime
def pascal_to_snake_case(s):
return s[0].lower() + "".join(
[i if i.islower() or i.isdigit() or i == "_" else "_" + i.lower() for i in s[1:]])
def pascal_to_dash_case(s):
return s[0].... | true | true |
1c14d8126127327b158761d7a420e0d2ec554763 | 1,410 | py | Python | res/7segment/7segment.py | honzatomek/PYTHON3 | 672b1e5e37b4a08271900ed5951db62b7cfd8f29 | [
"MIT"
] | null | null | null | res/7segment/7segment.py | honzatomek/PYTHON3 | 672b1e5e37b4a08271900ed5951db62b7cfd8f29 | [
"MIT"
] | null | null | null | res/7segment/7segment.py | honzatomek/PYTHON3 | 672b1e5e37b4a08271900ed5951db62b7cfd8f29 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# code modified, tweaked and tailored from code by bertwert
# on RPi forum thread topic 91796
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# GPIO ports for the 7seg pins
segments = (11,4,23,8,7,10,18,25)
# 7seg_segment_pins (11,7,4,2,1,10,5,3) + 100R inline
for segment in segmen... | 26.603774 | 70 | 0.531915 |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
segments = (11,4,23,8,7,10,18,25)
for segment in segments:
GPIO.setup(segment, GPIO.OUT)
GPIO.output(segment, 0)
digits = (22,27,17,24)
for digit in digits:
GPIO.setup(digit, GPIO.OUT)
GPIO.output(digit, 1)
num = {' ':(0,0,0,0,0,0,0)... | true | true |
1c14d902eb4e3c86d3c6ef3bef89053ed5263909 | 1,630 | py | Python | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/EXT/GL_422_pixels.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/EXT/GL_422_pixels.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/EXT/GL_422_pixels.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | '''OpenGL extension EXT.GL_422_pixels
Overview (from the spec)
This extension provides support for converting 422 pixels in host
memory to 444 pixels as part of the pixel storage operation.
The pixel unpack storage operation treats a 422 pixel as a 2 element
format where the first element is C (chrominance) an... | 40.75 | 78 | 0.8 | from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_GL_422_pixels'
GL_422_EXT = constant.Constant( 'GL_422_EXT', 0x80CC )
GL_422_REV_EXT = constant.Constant( 'GL_422_REV_EXT', 0x80CD )
GL_422_AVERAGE_EXT = constant.Con... | true | true |
1c14dad74f7a026882dd1134cad6ecf8d86ed015 | 9,042 | py | Python | examples/rnn-bench.py | mzj14/mesh | bf04d24e7a9c54733dea014b82e5985a039da67c | [
"Apache-2.0"
] | null | null | null | examples/rnn-bench.py | mzj14/mesh | bf04d24e7a9c54733dea014b82e5985a039da67c | [
"Apache-2.0"
] | null | null | null | examples/rnn-bench.py | mzj14/mesh | bf04d24e7a9c54733dea014b82e5985a039da67c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Mesh TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.974138 | 170 | 0.70438 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mesh_tensorflow as mtf
import mnist_dataset as dataset import tensorflow as tf
import time
tf.flags.DEFINE_string("data_dir", "data-source",
"Path to directory containing the M... | true | true |
1c14daf74874a422aea0f4237c01c13932838ebc | 821 | py | Python | ex2.py | E-Sakhno/lab5 | 9e7b31dd22057ecd7f60a3f9d4307abc73441e04 | [
"MIT"
] | null | null | null | ex2.py | E-Sakhno/lab5 | 9e7b31dd22057ecd7f60a3f9d4307abc73441e04 | [
"MIT"
] | null | null | null | ex2.py | E-Sakhno/lab5 | 9e7b31dd22057ecd7f60a3f9d4307abc73441e04 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
# Ввести список одной строкой.
a = list(map(int, input().split()))
# Если список пуст, завершить программу.
if not a:
print("Заданный список пуст", file=sys.stderr)
exit(1)
# Определить индексы миним... | 30.407407 | 64 | 0.585871 | import sys
if __name__ == '__main__':
a = list(map(int, input().split()))
if not a:
print("Заданный список пуст", file=sys.stderr)
exit(1)
a_min = a_max = a[0]
i_min = i_max = 0
for i, item in enumerate(a):
if item < a_min:
i_min, a_min = i, item
... | true | true |
1c14db3c20aeb30295ae04b51d0472e5b6c4c899 | 5,038 | py | Python | rllib/agents/ppo/appo.py | jamesliu/ray | 11ab412db1fa3603a3006e8ed414e80dd1f11c0c | [
"Apache-2.0"
] | 3 | 2020-12-12T05:10:44.000Z | 2021-04-12T21:52:47.000Z | rllib/agents/ppo/appo.py | jamesliu/ray | 11ab412db1fa3603a3006e8ed414e80dd1f11c0c | [
"Apache-2.0"
] | 125 | 2018-01-31T06:57:41.000Z | 2022-03-26T07:07:14.000Z | rllib/agents/ppo/appo.py | gramhagen/ray | c18caa4db36d466718bdbcb2229aa0b2dc03da1f | [
"Apache-2.0"
] | 1 | 2020-12-03T20:36:00.000Z | 2020-12-03T20:36:00.000Z | """
Asynchronous Proximal Policy Optimization (APPO)
================================================
This file defines the distributed Trainer class for the asynchronous version
of proximal policy optimization (APPO).
See `appo_[tf|torch]_policy.py` for the definition of the policy loss.
Detailed documentation:
http... | 35.230769 | 78 | 0.654625 | from typing import Optional, Type
from ray.rllib.agents.trainer import Trainer
from ray.rllib.agents.ppo.appo_tf_policy import AsyncPPOTFPolicy
from ray.rllib.agents.ppo.ppo import UpdateKL
from ray.rllib.agents import impala
from ray.rllib.policy.policy import Policy
from ray.rllib.execution.common import STEPS_SAMPL... | true | true |
1c14db77c2d6a177a8e0a68203a313f6d80ff913 | 215 | py | Python | tests/app.py | oleksis/pyinstaller-manylinux | 81fe5507738a2dc87ddca0ead4e99916aa007382 | [
"MIT"
] | 2 | 2020-11-05T03:44:39.000Z | 2020-11-11T19:49:18.000Z | tests/app.py | oleksis/pyinstaller-manylinux | 81fe5507738a2dc87ddca0ead4e99916aa007382 | [
"MIT"
] | null | null | null | tests/app.py | oleksis/pyinstaller-manylinux | 81fe5507738a2dc87ddca0ead4e99916aa007382 | [
"MIT"
] | 1 | 2020-11-11T19:51:14.000Z | 2020-11-11T19:51:14.000Z | #!/usr/bin/env python
# Simple App to create the binary in ManyLinux
# Create binary using Python 3.6
def main():
# Entrypoint
print("Hello out there \U0001F44B")
if __name__ == "__main__":
main() | 19.545455 | 46 | 0.665116 |
def main():
print("Hello out there \U0001F44B")
if __name__ == "__main__":
main() | true | true |
1c14db9e2a1b63d7367188ea34a8e699556c5f76 | 2,291 | py | Python | tests/test_cli.py | nplutt/pydantic-kms-secrets | dd424209ae7616897e43250b487d3fa8f6788b18 | [
"MIT"
] | 3 | 2020-10-29T16:13:30.000Z | 2022-01-06T15:10:01.000Z | tests/test_cli.py | nplutt/pydantic-kms-secrets | dd424209ae7616897e43250b487d3fa8f6788b18 | [
"MIT"
] | null | null | null | tests/test_cli.py | nplutt/pydantic-kms-secrets | dd424209ae7616897e43250b487d3fa8f6788b18 | [
"MIT"
] | 1 | 2022-01-06T01:11:07.000Z | 2022-01-06T01:11:07.000Z | from unittest.mock import MagicMock, patch
from pytest import mark
from pydantic_kms_secrets.cli import main, parse_args
@mark.parametrize(
("args", "decrypt_called", "encrypt_called", "expected"),
(
# Decrypt flag set to True
(
MagicMock(decrypt=True, encrypt=False, key_id="key"... | 30.144737 | 79 | 0.648625 | from unittest.mock import MagicMock, patch
from pytest import mark
from pydantic_kms_secrets.cli import main, parse_args
@mark.parametrize(
("args", "decrypt_called", "encrypt_called", "expected"),
(
(
MagicMock(decrypt=True, encrypt=False, key_id="key", value="val"),
... | true | true |
1c14dc7de2b7c545b6f207d53647d11304f93de2 | 87 | py | Python | asosiy/apps.py | UmarjonRajabov/Website-backend | cec2eff3326f501c21c037d649487fc4dfe5d8e1 | [
"MIT"
] | null | null | null | asosiy/apps.py | UmarjonRajabov/Website-backend | cec2eff3326f501c21c037d649487fc4dfe5d8e1 | [
"MIT"
] | 3 | 2021-06-08T22:17:21.000Z | 2022-03-12T00:46:32.000Z | asosiy/apps.py | UmarjonRajabov/Website-backend | cec2eff3326f501c21c037d649487fc4dfe5d8e1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class AsosiyConfig(AppConfig):
name = 'asosiy'
| 14.5 | 33 | 0.747126 | from django.apps import AppConfig
class AsosiyConfig(AppConfig):
name = 'asosiy'
| true | true |
1c14dea2237e4519dbc6fcd76fb24f9e524a421f | 13,192 | py | Python | utils/util.py | NEUdeep/TileDetection | f453ac868de195a7859b9bf07c813e46eb35d2d0 | [
"Apache-2.0"
] | null | null | null | utils/util.py | NEUdeep/TileDetection | f453ac868de195a7859b9bf07c813e46eb35d2d0 | [
"Apache-2.0"
] | null | null | null | utils/util.py | NEUdeep/TileDetection | f453ac868de195a7859b9bf07c813e46eb35d2d0 | [
"Apache-2.0"
] | null | null | null | import cv2
import concurrent.futures
import os
import numpy as np
import json
import copy
import random
import pickle
def get_root_path():
return os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
def sliding_crop_canny_imgs(img_dir,
save_crop_dir,
... | 39.615616 | 99 | 0.554958 | import cv2
import concurrent.futures
import os
import numpy as np
import json
import copy
import random
import pickle
def get_root_path():
return os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
def sliding_crop_canny_imgs(img_dir,
save_crop_dir,
... | true | true |
1c14deb4a80bd969e5384b162cb7000c27b2bbc9 | 1,237 | py | Python | 004-data-types/dataTypes.py | zaiddashti/python-tutorial | 9ae325999a79f5f6471e4126995a2219e5ba33a3 | [
"MIT"
] | null | null | null | 004-data-types/dataTypes.py | zaiddashti/python-tutorial | 9ae325999a79f5f6471e4126995a2219e5ba33a3 | [
"MIT"
] | null | null | null | 004-data-types/dataTypes.py | zaiddashti/python-tutorial | 9ae325999a79f5f6471e4126995a2219e5ba33a3 | [
"MIT"
] | null | null | null | # str
x = "Hello World"
x = str("Hello World")
# int
x = 20
x = int(20)
# float
x = 20.5
x = float(20.5)
# complex
x = 1j
x = complex(1j)
# list
colors = ["red", "green", "blue"]
colors = list(("red", "green", "blue"))
# tuple
colors = ("red", "green", "blue")
colors = tuple(("red", "green", "blue"))
# range
ra... | 11.894231 | 44 | 0.589329 | x = "Hello World"
x = str("Hello World")
x = 20
x = int(20)
x = 20.5
x = float(20.5)
x = 1j
x = complex(1j)
colors = ["red", "green", "blue"]
colors = list(("red", "green", "blue"))
colors = ("red", "green", "blue")
colors = tuple(("red", "green", "blue"))
range(6)
record = {"name" : "John", "age" : 36}
recor... | true | true |
1c14dfe2c4557b8a5bb7054b5c60dc5aa5f99127 | 423 | py | Python | py_proj_with_cc/cli.py | pandalearnstocode/py_proj_with_cc | 221caa80ab5c3ffcdca1a169505aa871bd7eab4e | [
"MIT"
] | null | null | null | py_proj_with_cc/cli.py | pandalearnstocode/py_proj_with_cc | 221caa80ab5c3ffcdca1a169505aa871bd7eab4e | [
"MIT"
] | null | null | null | py_proj_with_cc/cli.py | pandalearnstocode/py_proj_with_cc | 221caa80ab5c3ffcdca1a169505aa871bd7eab4e | [
"MIT"
] | null | null | null | """Console script for py_proj_with_cc."""
import sys
import click
@click.command()
def main(args=None):
"""Console script for py_proj_with_cc."""
click.echo("Replace this message by putting your code into "
"py_proj_with_cc.cli.main")
click.echo("See click documentation at https://click.pal... | 24.882353 | 79 | 0.680851 | import sys
import click
@click.command()
def main(args=None):
click.echo("Replace this message by putting your code into "
"py_proj_with_cc.cli.main")
click.echo("See click documentation at https://click.palletsprojects.com/")
return 0
if __name__ == "__main__":
sys.exit(main()) | true | true |
1c14dffd121a7fc713186a895f9f1076c217bfa2 | 19,179 | py | Python | vectorizers/timed_token_cooccurrence_vectorizer.py | scikit-learn-contrib/vectorizers | 45751ca46f8e7b4e042ed3edd4917e38818da28a | [
"BSD-3-Clause"
] | null | null | null | vectorizers/timed_token_cooccurrence_vectorizer.py | scikit-learn-contrib/vectorizers | 45751ca46f8e7b4e042ed3edd4917e38818da28a | [
"BSD-3-Clause"
] | null | null | null | vectorizers/timed_token_cooccurrence_vectorizer.py | scikit-learn-contrib/vectorizers | 45751ca46f8e7b4e042ed3edd4917e38818da28a | [
"BSD-3-Clause"
] | null | null | null | from .preprocessing import (
preprocess_timed_token_sequences,
)
from collections.abc import Iterable
from .base_cooccurrence_vectorizer import BaseCooccurrenceVectorizer
from .preprocessing import preprocess_timed_token_sequences
from .coo_utils import (
coo_append,
coo_sum_duplicates,
CooArray,
me... | 39.790456 | 108 | 0.665102 | from .preprocessing import (
preprocess_timed_token_sequences,
)
from collections.abc import Iterable
from .base_cooccurrence_vectorizer import BaseCooccurrenceVectorizer
from .preprocessing import preprocess_timed_token_sequences
from .coo_utils import (
coo_append,
coo_sum_duplicates,
CooArray,
me... | true | true |
1c14e069b5989e63bfede4a29563cf2a4094a079 | 1,223 | py | Python | instagram_scraper/tests/test_instagram.py | kevinsudut/instagram-scraper | 10922d7bbb40304608b5c254051f5e3b014c3f21 | [
"Unlicense"
] | 3,899 | 2015-01-17T02:01:08.000Z | 2020-05-28T18:38:02.000Z | instagram_scraper/tests/test_instagram.py | kevinsudut/instagram-scraper | 10922d7bbb40304608b5c254051f5e3b014c3f21 | [
"Unlicense"
] | 479 | 2015-07-23T04:52:29.000Z | 2020-05-27T16:56:07.000Z | instagram_scraper/tests/test_instagram.py | kevinsudut/instagram-scraper | 10922d7bbb40304608b5c254051f5e3b014c3f21 | [
"Unlicense"
] | 987 | 2015-03-24T10:50:41.000Z | 2020-05-28T14:28:55.000Z | import unittest
import os
import shutil
import tempfile
import requests_mock
import glob
from instagram_scraper import InstagramScraper
from instagram_scraper.constants import *
class InstagramTests(unittest.TestCase):
def setUp(self):
fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures')
... | 29.119048 | 75 | 0.617334 | import unittest
import os
import shutil
import tempfile
import requests_mock
import glob
from instagram_scraper import InstagramScraper
from instagram_scraper.constants import *
class InstagramTests(unittest.TestCase):
def setUp(self):
fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures')
... | true | true |
1c14e06b601103d804a1dcf71a83d70db773f873 | 96 | py | Python | venv/lib/python3.8/site-packages/distlib/scripts.py | Retraces/UkraineBot | 3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/distlib/scripts.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/distlib/scripts.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/b6/34/b0/10d20d795f7544e67179ce734d23118368c478a7387a7c821c3ccdbc41 | 96 | 96 | 0.895833 | /home/runner/.cache/pip/pool/b6/34/b0/10d20d795f7544e67179ce734d23118368c478a7387a7c821c3ccdbc41 | false | true |
1c14e091bedd270fef69b4738ae2a6ca191fe12b | 2,620 | py | Python | openaerostruct/structures/fuel_loads.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/structures/fuel_loads.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/structures/fuel_loads.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | 1 | 2021-04-09T16:45:27.000Z | 2021-04-09T16:45:27.000Z | import numpy as np
import openmdao.api as om
from openaerostruct.utils.constants import grav_constant
def norm(vec):
return np.sqrt(np.sum(vec**2))
class FuelLoads(om.ExplicitComponent):
"""
Compute the nodal loads from the distributed fuel within the wing
to be applied to the wing structure.
P... | 33.164557 | 122 | 0.602672 | import numpy as np
import openmdao.api as om
from openaerostruct.utils.constants import grav_constant
def norm(vec):
return np.sqrt(np.sum(vec**2))
class FuelLoads(om.ExplicitComponent):
def initialize(self):
self.options.declare('surface', types=dict)
def setup(self):
self.surface = s... | true | true |
1c14e0eae8f7e90c319ecd26676f9bec0566a6d7 | 2,196 | py | Python | agents/ProcessorAgent/ProcessorAgent.py | svtdanny/AntiSpam | 48465331c080d54807f34e61051ae3ee6d1d236e | [
"MIT"
] | null | null | null | agents/ProcessorAgent/ProcessorAgent.py | svtdanny/AntiSpam | 48465331c080d54807f34e61051ae3ee6d1d236e | [
"MIT"
] | null | null | null | agents/ProcessorAgent/ProcessorAgent.py | svtdanny/AntiSpam | 48465331c080d54807f34e61051ae3ee6d1d236e | [
"MIT"
] | null | null | null | import os
from flask import Flask, jsonify, request
from flask_restful import Api, Resource
import email
from urllib.parse import urlparse, parse_qsl
from Classificator import Classificator
import json
app = Flask(__name__)
api = Api(app)
@app.route('/', methods=['GET'])
def hello():
return 'Servise is workin... | 26.780488 | 124 | 0.597905 | import os
from flask import Flask, jsonify, request
from flask_restful import Api, Resource
import email
from urllib.parse import urlparse, parse_qsl
from Classificator import Classificator
import json
app = Flask(__name__)
api = Api(app)
@app.route('/', methods=['GET'])
def hello():
return 'Servise is workin... | true | true |
1c14e1b501666a1cdbf8a63d160a3820b54aad7c | 5,611 | py | Python | testscripts/RDKB/component/CMHAL/TS_CMHAL_GetNumOfActiveTxChannels_NullBuffer.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/CMHAL/TS_CMHAL_GetNumOfActiveTxChannels_NullBuffer.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/CMHAL/TS_CMHAL_GetNumOfActiveTxChannels_NullBuffer.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2016 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 42.507576 | 149 | 0.708073 | # file the following copyright and licenses apply:
#
# Copyright 2016 RDK Management
#
# 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 ... | false | true |
1c14e321538894ddf66b85999d645ec2afa7cb8b | 2,319 | py | Python | ascended_tracking/gui/app.py | verdesmarald/ascended-tracking | 93e17139ad39dc8d5d74eb3773c39b18738c5958 | [
"MIT"
] | null | null | null | ascended_tracking/gui/app.py | verdesmarald/ascended-tracking | 93e17139ad39dc8d5d74eb3773c39b18738c5958 | [
"MIT"
] | null | null | null | ascended_tracking/gui/app.py | verdesmarald/ascended-tracking | 93e17139ad39dc8d5d74eb3773c39b18738c5958 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""GUI entry point."""
import collections
import os
from datetime import datetime, timedelta
from time import sleep
import wx
from watchdog.events import FileSystemEventHandler
from ascended_tracking import parser, resource, watcher
from ascended_tracking.gui import panels
from... | 27.607143 | 86 | 0.677016 |
import collections
import os
from datetime import datetime, timedelta
from time import sleep
import wx
from watchdog.events import FileSystemEventHandler
from ascended_tracking import parser, resource, watcher
from ascended_tracking.gui import panels
from ascended_tracking.run import Run
from ascended_... | true | true |
1c14e35a231cd4c9d45eb4b4e6c7ec5fd25a08e1 | 29,764 | py | Python | python/ccxt/async_support/liquid.py | qbtrade/ccxt | ff625fc55bff733e570c4960f44578cfa3100666 | [
"MIT"
] | null | null | null | python/ccxt/async_support/liquid.py | qbtrade/ccxt | ff625fc55bff733e570c4960f44578cfa3100666 | [
"MIT"
] | null | null | null | python/ccxt/async_support/liquid.py | qbtrade/ccxt | ff625fc55bff733e570c4960f44578cfa3100666 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import A... | 38.958115 | 126 | 0.475138 |
from ccxt.async_support.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors im... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.