hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f3d53b857720c81e7ab41fe482781c4353b676 | 7,454 | py | Python | sensor/humidity.py | totomz/homelab | fa578cf7d7dbc8c4941d4944aa0fa8ff108156b7 | [
"MIT"
] | null | null | null | sensor/humidity.py | totomz/homelab | fa578cf7d7dbc8c4941d4944aa0fa8ff108156b7 | [
"MIT"
] | null | null | null | sensor/humidity.py | totomz/homelab | fa578cf7d7dbc8c4941d4944aa0fa8ff108156b7 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
import logging
import multiprocessing
from concurrent.futures.thread import ThreadPoolExecutor
from multiprocessing import Process
import statsd
import Adafruit_DHT
import time
import boto3
import sys
import subprocess
import os
from timeit import default_timer as timer
from threading import Thread
... | 30.056452 | 119 | 0.582909 |
import logging
import multiprocessing
from concurrent.futures.thread import ThreadPoolExecutor
from multiprocessing import Process
import statsd
import Adafruit_DHT
import time
import boto3
import sys
import subprocess
import os
from timeit import default_timer as timer
from threading import Thread
from threading impo... | true | true |
f7f3d5b166a71a417eaf549abf4f8f27055a0bd5 | 44,735 | py | Python | CUFFT timings/CUFFT_TIMINGS_GTX480_EVENT1x.py | Almajester/gpuLucas | 676cb45d76b3f157a1334fad6895868059dcc7d0 | [
"Unlicense"
] | 2 | 2018-07-07T06:10:04.000Z | 2021-05-19T01:34:26.000Z | CUFFT timings/CUFFT_TIMINGS_GTX480_EVENT1x.py | Almajester/gpuLucas | 676cb45d76b3f157a1334fad6895868059dcc7d0 | [
"Unlicense"
] | null | null | null | CUFFT timings/CUFFT_TIMINGS_GTX480_EVENT1x.py | Almajester/gpuLucas | 676cb45d76b3f157a1334fad6895868059dcc7d0 | [
"Unlicense"
] | 2 | 2018-04-12T18:33:36.000Z | 2019-01-30T19:50:18.000Z | [262144, 18, 0, 0, 0, 0.371648],
[262440, 3, 8, 1, 0, 0.521312],
[262500, 2, 1, 5, 1, 0.674624],
[263424, 8, 1, 0, 3, 0.506144],
[264600, 3, 3, 2, 2, 0.566176],
[268800, 9, 1, 2, 1, 0.550848],
[268912, 4, 0, 0, 5, 0.550144],
[270000, 4, 3, 4, 0, 0.575488],
[272160, 5, 5, 1, 1, 0.52688],
[273375, 0, 7, 3, 0, 3.56157],
[... | 32.091105 | 33 | 0.532916 | [262144, 18, 0, 0, 0, 0.371648],
[262440, 3, 8, 1, 0, 0.521312],
[262500, 2, 1, 5, 1, 0.674624],
[263424, 8, 1, 0, 3, 0.506144],
[264600, 3, 3, 2, 2, 0.566176],
[268800, 9, 1, 2, 1, 0.550848],
[268912, 4, 0, 0, 5, 0.550144],
[270000, 4, 3, 4, 0, 0.575488],
[272160, 5, 5, 1, 1, 0.52688],
[273375, 0, 7, 3, 0, 3.56157],
[... | true | true |
f7f3d71dda4b8914f21ffb70f5e7589dda8b5d78 | 1,083 | py | Python | large_app/python/api/auth/__init__.py | sahilGupta89/large_flask_app | e1ab54431bb935c02186f586d9246b741d9f2d33 | [
"MIT"
] | null | null | null | large_app/python/api/auth/__init__.py | sahilGupta89/large_flask_app | e1ab54431bb935c02186f586d9246b741d9f2d33 | [
"MIT"
] | null | null | null | large_app/python/api/auth/__init__.py | sahilGupta89/large_flask_app | e1ab54431bb935c02186f586d9246b741d9f2d33 | [
"MIT"
] | null | null | null | from flask import current_app, Response
from flask_login import LoginManager
from models import User
from . import basic_auth
from . import token_auth
login_manager = LoginManager()
@login_manager.request_loader
def load_user_from_auth_header(req) -> User:
"""Try via both http basic check and token auth to get ... | 24.066667 | 77 | 0.67313 | from flask import current_app, Response
from flask_login import LoginManager
from models import User
from . import basic_auth
from . import token_auth
login_manager = LoginManager()
@login_manager.request_loader
def load_user_from_auth_header(req) -> User:
methods = [
basic_auth.user_from_basic_auth_re... | true | true |
f7f3d8312041ef4bf86cc887dfcb2312a5d2e012 | 3,092 | py | Python | nets.py | AugustasVol/written_test_automation | 80d3295f741f4aaa3abaa4e85f20677ff59c146d | [
"MIT"
] | null | null | null | nets.py | AugustasVol/written_test_automation | 80d3295f741f4aaa3abaa4e85f20677ff59c146d | [
"MIT"
] | null | null | null | nets.py | AugustasVol/written_test_automation | 80d3295f741f4aaa3abaa4e85f20677ff59c146d | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
class net_base:
def trainer(self, x,y, epochs = 1, print_loss = True):
self.train(True)
for i in range(epochs):
self.op... | 27.607143 | 79 | 0.529431 | import numpy as np
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
class net_base:
def trainer(self, x,y, epochs = 1, print_loss = True):
self.train(True)
for i in range(epochs):
self.op... | true | true |
f7f3d90f5832134a2e7cb2c39538f43934bdca5b | 872 | py | Python | style_transfer.py | Markek1/style-transfer-gui | 14892d3c657242c4825129b56a6668904f53a65e | [
"MIT"
] | null | null | null | style_transfer.py | Markek1/style-transfer-gui | 14892d3c657242c4825129b56a6668904f53a65e | [
"MIT"
] | null | null | null | style_transfer.py | Markek1/style-transfer-gui | 14892d3c657242c4825129b56a6668904f53a65e | [
"MIT"
] | null | null | null | import os
import tensorflow as tf
def magenta_v1_256_2(content_image, style_image, resize=False, content_res=None, style_res=None):
'''Resolution of generated image = resolution of content image.
Resolution of the style image is 256x256 by default because the net
was trained on it and it generally w... | 39.636364 | 97 | 0.700688 | import os
import tensorflow as tf
def magenta_v1_256_2(content_image, style_image, resize=False, content_res=None, style_res=None):
if resize:
if content_res:
content_image = tf.image.resize(content_image, content_res)
if style_res:
style_image = tf.image.resize(style_imag... | true | true |
f7f3d9f83ec1b524ee082ad6285d34840c85e44a | 4,784 | py | Python | panel/tests/widgets/test_base.py | robmarkcole/panel | 8d28c99d8dba00ac44e1a8c1d534b96748c5513e | [
"BSD-3-Clause"
] | 1 | 2022-03-15T01:18:39.000Z | 2022-03-15T01:18:39.000Z | panel/tests/widgets/test_base.py | robmarkcole/panel | 8d28c99d8dba00ac44e1a8c1d534b96748c5513e | [
"BSD-3-Clause"
] | null | null | null | panel/tests/widgets/test_base.py | robmarkcole/panel | 8d28c99d8dba00ac44e1a8c1d534b96748c5513e | [
"BSD-3-Clause"
] | null | null | null | import param
import pytest
from panel.io import block_comm
from panel.layout import Row
from panel.links import CallbackGenerator
from panel.widgets import (
CompositeWidget, Dial, FileDownload, FloatSlider, TextInput,
Terminal, ToggleGroup, Tqdm, Widget
)
from panel.widgets.tables import BaseTable
from panel.... | 25.582888 | 100 | 0.675585 | import param
import pytest
from panel.io import block_comm
from panel.layout import Row
from panel.links import CallbackGenerator
from panel.widgets import (
CompositeWidget, Dial, FileDownload, FloatSlider, TextInput,
Terminal, ToggleGroup, Tqdm, Widget
)
from panel.widgets.tables import BaseTable
from panel.... | true | true |
f7f3d9fa4822c626cc3ed2ceaac1567d407ca197 | 813 | py | Python | hfpy_code/chapter11/find_it.py | leobarros/use_cabeca_python | 4e0897a68fb7ef669ec05eab7cba9412baa0e85e | [
"Apache-2.0"
] | 1 | 2016-04-01T04:31:52.000Z | 2016-04-01T04:31:52.000Z | hfpython_code/hfpy_code/chapter11/find_it.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | 2 | 2018-11-27T10:45:45.000Z | 2018-12-13T14:44:54.000Z | hfpython_code/hfpy_code/chapter11/find_it.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | 1 | 2020-06-02T17:47:22.000Z | 2020-06-02T17:47:22.000Z |
import time
def find_closest(look_for, target_data):
def whats_the_difference(first, second):
if first == second:
return(0)
elif first > second:
return(first - second)
else:
return(second - first)
max_diff = 9999999
for each_thing in target_dat... | 25.40625 | 61 | 0.591636 |
import time
def find_closest(look_for, target_data):
def whats_the_difference(first, second):
if first == second:
return(0)
elif first > second:
return(first - second)
else:
return(second - first)
max_diff = 9999999
for each_thing in target_dat... | true | true |
f7f3db128e8354d2dbf6759a8bf6ed10872aa560 | 539 | py | Python | nicos_mlz/refsans/setups/nok/nokbus1.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/refsans/setups/nok/nokbus1.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/refsans/setups/nok/nokbus1.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'IPC Motor bus device configuration'
group = 'lowlevel'
instrument_values = configdata('instrument.values')
tango_base = instrument_values['tango_base']
# data from instrument.inf
# used for:
# - shutter_gamma (addr 0x31)
# - nok2 (addr 0x32, 0x33)
# - nok3 (addr 0x34, 0x35)
# - nok4 reactor side (add... | 21.56 | 63 | 0.680891 | description = 'IPC Motor bus device configuration'
group = 'lowlevel'
instrument_values = configdata('instrument.values')
tango_base = instrument_values['tango_base']
devices = dict(
nokbus1 = device('nicos.devices.vendor.ipc.IPCModBusTango',
tangodevice = tango_base + 'test/ipcsms_a/bio',
... | true | true |
f7f3db59e7610b5ea7aa3ff7ba67d478892b280b | 1,559 | py | Python | code/chapter5/dorm.py | hackrole/collective-intelligence-program | 2fd1f23e2d277f89e359b8c4f7751dfdd672f110 | [
"MIT"
] | null | null | null | code/chapter5/dorm.py | hackrole/collective-intelligence-program | 2fd1f23e2d277f89e359b8c4f7751dfdd672f110 | [
"MIT"
] | null | null | null | code/chapter5/dorm.py | hackrole/collective-intelligence-program | 2fd1f23e2d277f89e359b8c4f7751dfdd672f110 | [
"MIT"
] | null | null | null | import random
import math
# The dorms, each of which has two available spaces
dorms=['Zeus','Athena','Hercules','Bacchus','Pluto']
# People, along with their first and second choices
prefs=[('Toby', ('Bacchus', 'Hercules')),
('Steve', ('Zeus', 'Pluto')),
('Karen', ('Athena', 'Zeus')),
(... | 26.87931 | 63 | 0.55356 | import random
import math
dorms=['Zeus','Athena','Hercules','Bacchus','Pluto']
prefs=[('Toby', ('Bacchus', 'Hercules')),
('Steve', ('Zeus', 'Pluto')),
('Karen', ('Athena', 'Zeus')),
('Sarah', ('Zeus', 'Pluto')),
('Dave', ('Athena', 'Bacchus')),
('Jeff', ('Hercules', 'Pl... | false | true |
f7f3db78d302ce85c9d7e6e0751247f2f9ba494d | 1,374 | py | Python | compiler/tests/03_ptx_4finger_nmos_test.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | 2 | 2019-12-30T11:41:21.000Z | 2020-02-15T00:15:32.000Z | compiler/tests/03_ptx_4finger_nmos_test.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | null | null | null | compiler/tests/03_ptx_4finger_nmos_test.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import unittest
from test... | 31.227273 | 81 | 0.641921 |
import unittest
from testutils import *
import sys,os
sys.path.append(os.getenv("OPENRAM_HOME"))
import globals
from globals import OPTS
from sram_factory import factory
import debug
class ptx_4finger_nmos_test(openram_test):
def runTest(self):
config_file = "{}/tests/configs/config".format(os.get... | true | true |
f7f3dc1d22629a2503969330b293f6d236abdbcf | 427 | py | Python | day1/part1/day1_part1.py | kreako/advent-of-code-2021 | 3a002a14c54cd455327d52732b8f057a20f3eb37 | [
"MIT"
] | null | null | null | day1/part1/day1_part1.py | kreako/advent-of-code-2021 | 3a002a14c54cd455327d52732b8f057a20f3eb37 | [
"MIT"
] | null | null | null | day1/part1/day1_part1.py | kreako/advent-of-code-2021 | 3a002a14c54cd455327d52732b8f057a20f3eb37 | [
"MIT"
] | null | null | null | def count(in_: list[int]) -> int:
previous = None
count = 0
for i in in_:
if previous is not None and previous < i:
count += 1
previous = i
return count
if __name__ == "__main__":
print(count([199, 200, 208, 210, 200, 207, 240, 269, 260, 263]))
with open("input", "r... | 25.117647 | 68 | 0.557377 | def count(in_: list[int]) -> int:
previous = None
count = 0
for i in in_:
if previous is not None and previous < i:
count += 1
previous = i
return count
if __name__ == "__main__":
print(count([199, 200, 208, 210, 200, 207, 240, 269, 260, 263]))
with open("input", "r... | true | true |
f7f3dd1d613df470928aadce33864634b05f3e78 | 3,858 | py | Python | results/models/athletes.py | JukkaKarvonen/sal-kiti | 3dcff71552ab323e3c97eccf502c0d72eb683967 | [
"MIT"
] | 1 | 2021-06-12T08:46:32.000Z | 2021-06-12T08:46:32.000Z | results/models/athletes.py | JukkaKarvonen/sal-kiti | 3dcff71552ab323e3c97eccf502c0d72eb683967 | [
"MIT"
] | 8 | 2020-07-01T15:06:52.000Z | 2022-02-20T09:11:23.000Z | results/models/athletes.py | JukkaKarvonen/sal-kiti | 3dcff71552ab323e3c97eccf502c0d72eb683967 | [
"MIT"
] | 3 | 2020-03-01T17:02:24.000Z | 2020-07-05T14:37:59.000Z | from django.db import models
from django.utils.translation import ugettext_lazy as _
from dry_rest_permissions.generics import allow_staff_or_superuser, authenticated_users
from results.mixins.change_log import LogChangesMixing
from results.models.organizations import Organization
class Athlete(LogChangesMixing, mod... | 33.842105 | 120 | 0.70451 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from dry_rest_permissions.generics import allow_staff_or_superuser, authenticated_users
from results.mixins.change_log import LogChangesMixing
from results.models.organizations import Organization
class Athlete(LogChangesMixing, mod... | true | true |
f7f3dd222c1c9b6b9d4795f49c76de0b2c499e0c | 5,073 | py | Python | python/main.py | skerit/gezicht | 5361b06e250400b0f1b44faf6f8940b0f39ed5d9 | [
"MIT"
] | null | null | null | python/main.py | skerit/gezicht | 5361b06e250400b0f1b44faf6f8940b0f39ed5d9 | [
"MIT"
] | null | null | null | python/main.py | skerit/gezicht | 5361b06e250400b0f1b44faf6f8940b0f39ed5d9 | [
"MIT"
] | null | null | null | import face_recognition
import importlib
import numpy as np
import socket
import time
import json
import sys
import os
from PIL import Image
from io import BytesIO
pi_spec = importlib.util.find_spec("picamera")
found_picam = pi_spec is not None
_picam = False
has_cv = False
picam_options = {
'rotation' : 90
}
# Mak... | 20.876543 | 73 | 0.677311 | import face_recognition
import importlib
import numpy as np
import socket
import time
import json
import sys
import os
from PIL import Image
from io import BytesIO
pi_spec = importlib.util.find_spec("picamera")
found_picam = pi_spec is not None
_picam = False
has_cv = False
picam_options = {
'rotation' : 90
}
e... | true | true |
f7f3de284304a608bb5c4c56c1e11a5b4da2e1fc | 21,364 | py | Python | tools/scons/scons-local-3.0.5/SCons/Tool/MSCommon/vs.py | arcilat-adsk/arnold-usd | 34f1b091221f81d027a0c9fceec10f3cfa3ba141 | [
"Apache-2.0"
] | 2 | 2020-12-01T03:34:51.000Z | 2021-03-06T01:49:44.000Z | tools/scons/scons-local-3.0.5/SCons/Tool/MSCommon/vs.py | arcilat-adsk/arnold-usd | 34f1b091221f81d027a0c9fceec10f3cfa3ba141 | [
"Apache-2.0"
] | null | null | null | tools/scons/scons-local-3.0.5/SCons/Tool/MSCommon/vs.py | arcilat-adsk/arnold-usd | 34f1b091221f81d027a0c9fceec10f3cfa3ba141 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# 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... | 37.284468 | 122 | 0.61716 |
__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan"
__doc__ = """Module to detect Visual Studio and/or Visual C/C++
"""
import os
import SCons.Errors
import SCons.Util
from .common import debug, \
get_ou... | true | true |
f7f3e02f1a7e2e2553d2bc80d28a8f17f4fb5da5 | 18,716 | py | Python | model/__init__.py | schrodit/cc-utils | db46303b1299b8816014daedf17cb6b8180bb491 | [
"BSD-3-Clause"
] | null | null | null | model/__init__.py | schrodit/cc-utils | db46303b1299b8816014daedf17cb6b8180bb491 | [
"BSD-3-Clause"
] | null | null | null | model/__init__.py | schrodit/cc-utils | db46303b1299b8816014daedf17cb6b8180bb491 | [
"BSD-3-Clause"
] | null | null | null | import dataclasses
import functools
import json
import os
import pkgutil
import sys
import typing
import urllib.parse
import dacite
import deprecated
import yaml
from model.base import (
ConfigElementNotFoundError,
ModelValidationError,
NamedModelElement,
)
from ci.util import (
existing_dir,
not_... | 33.008818 | 101 | 0.62476 | import dataclasses
import functools
import json
import os
import pkgutil
import sys
import typing
import urllib.parse
import dacite
import deprecated
import yaml
from model.base import (
ConfigElementNotFoundError,
ModelValidationError,
NamedModelElement,
)
from ci.util import (
existing_dir,
not_... | true | true |
f7f3e06fe4fdcf1eecaf0307a964d34e523c9087 | 5,775 | py | Python | test/unit/test_receipt.py | pavel52rus/yandex-checkout-sdk-python | 10c8b0ce12712bca675254f2a230f9fc0e1cb9b4 | [
"MIT"
] | null | null | null | test/unit/test_receipt.py | pavel52rus/yandex-checkout-sdk-python | 10c8b0ce12712bca675254f2a230f9fc0e1cb9b4 | [
"MIT"
] | null | null | null | test/unit/test_receipt.py | pavel52rus/yandex-checkout-sdk-python | 10c8b0ce12712bca675254f2a230f9fc0e1cb9b4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from yandex_checkout.domain.models.amount import Amount
from yandex_checkout.domain.models.currency import Currency
from yandex_checkout.domain.models.receipt import Receipt
from yandex_checkout.domain.models.receipt_customer import ReceiptCustomer
from yandex_checkout.domain.mo... | 38.758389 | 134 | 0.491948 |
import unittest
from yandex_checkout.domain.models.amount import Amount
from yandex_checkout.domain.models.currency import Currency
from yandex_checkout.domain.models.receipt import Receipt
from yandex_checkout.domain.models.receipt_customer import ReceiptCustomer
from yandex_checkout.domain.models.receipt_item impor... | true | true |
f7f3e0e97869246bb02792b6ad6050255f2e66d8 | 2,694 | py | Python | lib/googlecloudsdk/core/resolvers.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/resolvers.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/resolvers.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
"""Resolvers for resource parameters."""
from googlecloudsdk.core import exceptions
class Error(exceptions.Error):
"""Errors for this module."""
class InconsistentArgumentError(Error):
def __init__(self, param, values):
super(InconsistentArgumentError, s... | 28.659574 | 80 | 0.707498 |
from googlecloudsdk.core import exceptions
class Error(exceptions.Error):
class InconsistentArgumentError(Error):
def __init__(self, param, values):
super(InconsistentArgumentError, self).__init__(
'got multiple values for [{param}]: {values}'.format(
param=param,
values='... | true | true |
f7f3e27ff9d88bbdbc1b4e434eabaf57988ea1c8 | 589 | py | Python | DMOJ/DMOPC/DMOPC_19_C6P2_Grade_10_Math.py | Togohogo1/pg | ee3c36acde47769c66ee13a227762ee677591375 | [
"MIT"
] | null | null | null | DMOJ/DMOPC/DMOPC_19_C6P2_Grade_10_Math.py | Togohogo1/pg | ee3c36acde47769c66ee13a227762ee677591375 | [
"MIT"
] | 1 | 2021-10-14T18:26:56.000Z | 2021-10-14T18:26:56.000Z | DMOJ/DMOPC/DMOPC_19_C6P2_Grade_10_Math.py | Togohogo1/pg | ee3c36acde47769c66ee13a227762ee677591375 | [
"MIT"
] | 1 | 2021-08-06T03:39:55.000Z | 2021-08-06T03:39:55.000Z | a, b = map(int, input().split())
def primeFactors(n):
primes = []
while n % 2 == 0:
primes.append(2)
n //= 2
for i in range(3, int(n**0.5+1), 2):
while n % i == 0:
primes.append(i)
n //= i
if n > 2:
primes.append(n)
return primes
def fa... | 14.365854 | 46 | 0.480475 | a, b = map(int, input().split())
def primeFactors(n):
primes = []
while n % 2 == 0:
primes.append(2)
n //= 2
for i in range(3, int(n**0.5+1), 2):
while n % i == 0:
primes.append(i)
n //= i
if n > 2:
primes.append(n)
return primes
def fa... | true | true |
f7f3e295196a94a0944693cf9e4518fb9dc94a3c | 1,141 | py | Python | Sorting/mergeSort.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | Sorting/mergeSort.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | Sorting/mergeSort.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | from collections import deque
"""
nlog(n)
"""
def merge(lList, rList):
'''
Return a merged list
'''
result=[]
left_list=deque(lList)
right_list=deque(rList)
while len(left_list)!=0 and len(right_list)!=0:
'''
Wrong idea here is trying to pop the first element at first, some ... | 27.829268 | 110 | 0.629273 | from collections import deque
def merge(lList, rList):
result=[]
left_list=deque(lList)
right_list=deque(rList)
while len(left_list)!=0 and len(right_list)!=0:
if left_list[0]>right_list[0]:
result.append(left_list.popleft())
else:
result.append(right_list.poplef... | true | true |
f7f3e2acc10d9f1bf59378bbb9801a027544671f | 334 | py | Python | packaging/flydra_compat/flydra/__init__.py | elhananby/flydra | 09b86859b1863700cdea0bbcdd4758da6c83930b | [
"Apache-2.0",
"MIT"
] | 45 | 2017-08-25T06:46:56.000Z | 2021-08-29T16:42:49.000Z | packaging/flydra_compat/flydra/__init__.py | elhananby/flydra | 09b86859b1863700cdea0bbcdd4758da6c83930b | [
"Apache-2.0",
"MIT"
] | 7 | 2017-10-16T10:46:20.000Z | 2020-12-03T16:42:55.000Z | packaging/flydra_compat/flydra/__init__.py | elhananby/flydra | 09b86859b1863700cdea0bbcdd4758da6c83930b | [
"Apache-2.0",
"MIT"
] | 21 | 2018-04-11T09:06:40.000Z | 2021-12-26T23:38:40.000Z | import os
import sys
from flydra import *
import warnings
__version__ = "0.1.0"
err_str = ('The module "flydra" is deprecated. Use "flydra_core" or '
'"flydra_camnode" as appropriate instead.')
if os.environ.get('FLYDRA_NO_BACKWARDS_COMPAT','0') != '0':
raise ImportError(err_str)
warnings.warn(err_str, Deprec... | 25.692308 | 69 | 0.739521 | import os
import sys
from flydra import *
import warnings
__version__ = "0.1.0"
err_str = ('The module "flydra" is deprecated. Use "flydra_core" or '
'"flydra_camnode" as appropriate instead.')
if os.environ.get('FLYDRA_NO_BACKWARDS_COMPAT','0') != '0':
raise ImportError(err_str)
warnings.warn(err_str, Deprec... | true | true |
f7f3e66a5be1ae0e22867e4f3957cc4e86c4f87c | 4,908 | py | Python | app/map.py | mbroz/feel-the-streets | 6e21a496f1530b0500ca66e11712f3f31cd857ae | [
"MIT"
] | null | null | null | app/map.py | mbroz/feel-the-streets | 6e21a496f1530b0500ca66e11712f3f31cd857ae | [
"MIT"
] | null | null | null | app/map.py | mbroz/feel-the-streets | 6e21a496f1530b0500ca66e11712f3f31cd857ae | [
"MIT"
] | null | null | null | import logging
from osm_db import EntitiesQuery, FieldNamed, AreaDatabase
from pygeodesy.ellipsoidalVincenty import LatLon
import shapely.wkb as wkb
from shapely.geometry.point import Point
from .geometry_utils import distance_filter, effective_width_filter, xy_ranges_bounding_square
from .measuring import measur... | 41.243697 | 124 | 0.66361 | import logging
from osm_db import EntitiesQuery, FieldNamed, AreaDatabase
from pygeodesy.ellipsoidalVincenty import LatLon
import shapely.wkb as wkb
from shapely.geometry.point import Point
from .geometry_utils import distance_filter, effective_width_filter, xy_ranges_bounding_square
from .measuring import measur... | true | true |
f7f3e721b0c4175f354707eecb8a4ada1528d845 | 4,757 | py | Python | etl/imap_to_redshift.py | airflow-plugins/example_dags | 3cf6b9bb59aa99dfadfef0391530b55a599bc55c | [
"Apache-2.0"
] | 297 | 2018-02-14T03:36:35.000Z | 2022-03-30T22:18:07.000Z | etl/imap_to_redshift.py | airflow-plugins/example_dags | 3cf6b9bb59aa99dfadfef0391530b55a599bc55c | [
"Apache-2.0"
] | 1 | 2018-09-28T23:16:41.000Z | 2018-09-28T23:16:41.000Z | etl/imap_to_redshift.py | airflow-plugins/example_dags | 3cf6b9bb59aa99dfadfef0391530b55a599bc55c | [
"Apache-2.0"
] | 68 | 2018-03-02T03:43:58.000Z | 2022-01-18T05:11:04.000Z | """
An example DAG designed to:
1) Access an IMAP Server
2) Search the inbox for an email with a specific subject
3) Pull in the csv attachments of the email and store them in S3
4) Load these files into Redshift.
This files contains one dag:
- An ongoing daily workflow.
Each DAG makes use of two custom operators... | 32.582192 | 107 | 0.54383 |
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators import ImapToS3Operator
from airflow.operators import S3ToRedshiftOperator
IMAP_CONN_ID = ''
IMAP_EMAIL = ''
S3_CONN_ID = ''
S3_BUCKET = ''
REDSHIFT_SCHEMA = ''
REDSHIFT... | true | true |
f7f3e8706acc596ed0eef493ac28fd2a40d8bded | 4,983 | py | Python | test/py/ganeti.utils.filelock_unittest.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 396 | 2015-01-22T11:44:32.000Z | 2022-03-31T14:14:29.000Z | test/py/ganeti.utils.filelock_unittest.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 1,550 | 2015-04-05T09:53:50.000Z | 2022-03-28T17:42:20.000Z | test/py/ganeti.utils.filelock_unittest.py | modulus-sa/ganeti | 592c0e945cc2c7b0013f813ea8c9d8ec0d5bab98 | [
"BSD-2-Clause"
] | 119 | 2015-01-06T21:37:15.000Z | 2022-03-07T06:36:26.000Z | #!/usr/bin/python3
#
# Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright not... | 30.759259 | 79 | 0.737307 |
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import os
import tempfile
import unittest
from ganeti import constants
from ganeti import utils
from ganeti import errors
import testutils
class _BaseFileLockTest:
def testSharedNonblocking(self):
self.lock.... | true | true |
f7f3e8d60512c804f1371da5a0a56013b61aa0f9 | 2,873 | py | Python | pgoapi/protos/pogoprotos/networking/requests/messages/set_favorite_pokemon_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 14 | 2017-03-28T16:32:24.000Z | 2021-03-13T23:03:57.000Z | pgoapi/protos/pogoprotos/networking/requests/messages/set_favorite_pokemon_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 8 | 2017-03-01T07:56:09.000Z | 2017-08-15T07:37:12.000Z | pgoapi/protos/pogoprotos/networking/requests/messages/set_favorite_pokemon_message_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 15 | 2017-02-24T01:30:23.000Z | 2021-06-27T08:46:43.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/requests/messages/set_favorite_pokemon_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message... | 37.311688 | 275 | 0.79464 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f7f3e90b2429ce72a4f1dab94e578a3c8861ace0 | 2,724 | py | Python | py/desispec/io/sky.py | Srheft/desispec | f7adfd70e245cfe861b1e6eb781d1216017bed28 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/io/sky.py | Srheft/desispec | f7adfd70e245cfe861b1e6eb781d1216017bed28 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/io/sky.py | Srheft/desispec | f7adfd70e245cfe861b1e6eb781d1216017bed28 | [
"BSD-3-Clause"
] | null | null | null | """
desispec.io.sky
===============
IO routines for sky.
"""
from __future__ import absolute_import, division
import os
from astropy.io import fits
def write_sky(outfile, skymodel, header=None):
"""Write sky model.
Args:
outfile : filename or (night, expid, camera) tuple
skymodel : SkyModel ... | 31.674419 | 83 | 0.654552 | from __future__ import absolute_import, division
import os
from astropy.io import fits
def write_sky(outfile, skymodel, header=None):
from desiutil.depend import add_dependencies
from .util import fitsheader, makepath
outfile = makepath(outfile, 'sky')
if header is not None:
hdr = fitsh... | true | true |
f7f3e99268870f25eacb1330d625529215573109 | 106 | py | Python | Ch2/helloworld_start.py | prottoyghose/python_essentials | 029e3208b4be343315d384b6f6a4d77eb25f9fcb | [
"Apache-2.0"
] | null | null | null | Ch2/helloworld_start.py | prottoyghose/python_essentials | 029e3208b4be343315d384b6f6a4d77eb25f9fcb | [
"Apache-2.0"
] | null | null | null | Ch2/helloworld_start.py | prottoyghose/python_essentials | 029e3208b4be343315d384b6f6a4d77eb25f9fcb | [
"Apache-2.0"
] | null | null | null | #
# Example file for HelloWorld
#
def main():
print("hello world")
if __name__ == "__main__":
main() | 11.777778 | 29 | 0.641509 |
def main():
print("hello world")
if __name__ == "__main__":
main() | true | true |
f7f3ea328c80e6b8da0d6675dab4712f016ff19d | 36 | py | Python | torchfold/__init__.py | mhoangvslev/torchfold | 9285c7889f2e1966fb94c4b8a3e91bcd60e40ab2 | [
"Apache-2.0"
] | 160 | 2017-08-22T23:32:08.000Z | 2018-06-05T02:58:58.000Z | torchfold/__init__.py | mhoangvslev/torchfold | 9285c7889f2e1966fb94c4b8a3e91bcd60e40ab2 | [
"Apache-2.0"
] | 4 | 2018-08-02T15:37:20.000Z | 2020-02-28T18:30:41.000Z | torchfold/__init__.py | mhoangvslev/torchfold | 9285c7889f2e1966fb94c4b8a3e91bcd60e40ab2 | [
"Apache-2.0"
] | 13 | 2017-09-07T14:55:06.000Z | 2018-06-07T18:03:08.000Z | from .torchfold import Fold, Unfold
| 18 | 35 | 0.805556 | from .torchfold import Fold, Unfold
| true | true |
f7f3eb1a505efdcbc9fe19f1db0cdf99c7afce65 | 1,733 | py | Python | fds/fds_request.py | XiaoMi/galaxy-fds-sdk-python | fd6f0203d879effc9db853b2691f0fbb5a46639b | [
"Apache-2.0"
] | 42 | 2015-07-23T07:02:06.000Z | 2022-03-30T09:08:30.000Z | fds/fds_request.py | XiaoMi/galaxy-fds-sdk-python | fd6f0203d879effc9db853b2691f0fbb5a46639b | [
"Apache-2.0"
] | 3 | 2017-02-08T09:36:37.000Z | 2020-08-03T02:04:27.000Z | fds/fds_request.py | XiaoMi/galaxy-fds-sdk-python | fd6f0203d879effc9db853b2691f0fbb5a46639b | [
"Apache-2.0"
] | 24 | 2016-04-01T12:30:23.000Z | 2022-03-29T02:04:35.000Z | # wrap the requests library
import requests
from requests.sessions import HTTPAdapter
class FDSRequest:
def __init__(self, timeout, max_retries):
self._max_retries = max_retries
self._timeout = timeout
def request(self, method, url, kwargs):
'''
Constructs a specified session and sends quest.
... | 30.946429 | 78 | 0.684362 |
import requests
from requests.sessions import HTTPAdapter
class FDSRequest:
def __init__(self, timeout, max_retries):
self._max_retries = max_retries
self._timeout = timeout
def request(self, method, url, kwargs):
kwargs.setdefault('timeout', self._timeout)
session = requests.Session()
ses... | true | true |
f7f3eb5c195c6b58b7d1750db99e9038af7bfd68 | 7,235 | py | Python | fuzzers/aflplusplus/fuzzer.py | zzyyrr/fuzzbench | 7805093436f36ddaef155da8b045da2b57ec02b2 | [
"Apache-2.0"
] | 1 | 2021-03-30T01:23:33.000Z | 2021-03-30T01:23:33.000Z | fuzzers/aflplusplus/fuzzer.py | zzyyrr/fuzzbench | 7805093436f36ddaef155da8b045da2b57ec02b2 | [
"Apache-2.0"
] | null | null | null | fuzzers/aflplusplus/fuzzer.py | zzyyrr/fuzzbench | 7805093436f36ddaef155da8b045da2b57ec02b2 | [
"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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | 39.752747 | 136 | 0.672564 |
import os
import shutil
from fuzzers.afl import fuzzer as afl_fuzzer
from fuzzers import utils
def get_cmplog_build_directory(target_directory):
return os.path.join(target_directory, 'cmplog')
def build(*args):
build_modes = list(args)
if 'BUILD_MODES' in os.environ:
... | true | true |
f7f3eb8d00a84ed5e552cb82612616f7fbe779c4 | 2,415 | py | Python | cls_ann.py | ZHUXUHAN/Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | 1 | 2019-11-20T12:16:21.000Z | 2019-11-20T12:16:21.000Z | cls_ann.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | cls_ann.py | ZHUXUHAN/Python-Tools | 98a0776f460febc69af5523e2c69d7702ee04876 | [
"MIT"
] | null | null | null | import os
import random
import shutil
dir = '/home/xuhanzhu/panet/data/cifar2..'
dir2 = '/home/xuhanzhu/panet/cifar2'
files = os.listdir(dir)
def split():
length = [0, 0]
file_split = [[], []]
for file in files:
if 'Normal' in file:
length[0] += 1
file_split[0].append(file)... | 35 | 109 | 0.549482 | import os
import random
import shutil
dir = '/home/xuhanzhu/panet/data/cifar2..'
dir2 = '/home/xuhanzhu/panet/cifar2'
files = os.listdir(dir)
def split():
length = [0, 0]
file_split = [[], []]
for file in files:
if 'Normal' in file:
length[0] += 1
file_split[0].append(file)... | true | true |
f7f3ebab586a51790f18aec397c4c6f90237218a | 4,613 | py | Python | onnx_chainer/functions/normalization.py | disktnk/onnx-chainer | e4542568009e63e7da83aa0f11b2cb5504e8cef8 | [
"MIT"
] | null | null | null | onnx_chainer/functions/normalization.py | disktnk/onnx-chainer | e4542568009e63e7da83aa0f11b2cb5504e8cef8 | [
"MIT"
] | null | null | null | onnx_chainer/functions/normalization.py | disktnk/onnx-chainer | e4542568009e63e7da83aa0f11b2cb5504e8cef8 | [
"MIT"
] | null | null | null | import sys
import chainer
import numpy as np
from onnx_chainer.functions.opset_version import support
from onnx_chainer import onnx_helper
@support((1, 6, 7))
def convert_BatchNormalization(func, opset_version, input_names,
output_names, context, parameters):
is_fixed_bn = len(fun... | 35.21374 | 79 | 0.608281 | import sys
import chainer
import numpy as np
from onnx_chainer.functions.opset_version import support
from onnx_chainer import onnx_helper
@support((1, 6, 7))
def convert_BatchNormalization(func, opset_version, input_names,
output_names, context, parameters):
is_fixed_bn = len(fun... | true | true |
f7f3ec4b28aa9e90f75fc4de08f156743cca8e87 | 1,295 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/wizard/hr_holidays_summary_department.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/wizard/hr_holidays_summary_department.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/wizard/hr_holidays_summary_department.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class HolidaysSummaryDept(models.TransientModel):
_name = 'hr.holidays.summary.dept'
_description = 'HR Leaves Summary ... | 37 | 110 | 0.639382 |
import time
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class HolidaysSummaryDept(models.TransientModel):
_name = 'hr.holidays.summary.dept'
_description = 'HR Leaves Summary Report By Department'
date_from = fields.Date(string='From', required=True, default=lambda *... | true | true |
f7f3ed8d742bf7fa720677c7a38e6fbf2e2b3645 | 989 | py | Python | src/enemy.py | mshopper/acv | e8d2ee8c082c6a9e4c0255b5113ade357fb9848d | [
"Apache-2.0"
] | 1 | 2015-08-25T13:33:06.000Z | 2015-08-25T13:33:06.000Z | src/enemy.py | maigimenez/acv | e8d2ee8c082c6a9e4c0255b5113ade357fb9848d | [
"Apache-2.0"
] | null | null | null | src/enemy.py | maigimenez/acv | e8d2ee8c082c6a9e4c0255b5113ade357fb9848d | [
"Apache-2.0"
] | null | null | null | import pygame
class Enemy(pygame.sprite.Sprite):
def __init__(self, location, *groups):
super(Enemy, self).__init__(*groups)
self.direction = 1
self.image_left = pygame.image.load('resources/characters/enemy1_izquierda.png')
self.image_right = pygame.image.load('resources/character... | 39.56 | 88 | 0.607685 | import pygame
class Enemy(pygame.sprite.Sprite):
def __init__(self, location, *groups):
super(Enemy, self).__init__(*groups)
self.direction = 1
self.image_left = pygame.image.load('resources/characters/enemy1_izquierda.png')
self.image_right = pygame.image.load('resources/character... | true | true |
f7f3ef8cf0d4a008df4b2cb0cf8dc8bc53925875 | 9,799 | py | Python | lib/googlecloudsdk/core/cache/sqlite_cache.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/cache/sqlite_cache.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/cache/sqlite_cache.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.996429 | 80 | 0.662925 |
from __future__ import absolute_import
from __future__ import division
import errno
import os
from googlecloudsdk.core.cache import exceptions
from googlecloudsdk.core.cache import metadata_table
from googlecloudsdk.core.cache import persistent_cache_base
import six
from six.moves import range
impo... | true | true |
f7f3f02200d922de128116b97d7b01806f2ee190 | 4,596 | py | Python | src/app/drivers/mslookup/seqspace.py | husensofteng/msstitch | a917ed24fbc8b018b3f2bbec31e852aa76cc715c | [
"MIT"
] | null | null | null | src/app/drivers/mslookup/seqspace.py | husensofteng/msstitch | a917ed24fbc8b018b3f2bbec31e852aa76cc715c | [
"MIT"
] | null | null | null | src/app/drivers/mslookup/seqspace.py | husensofteng/msstitch | a917ed24fbc8b018b3f2bbec31e852aa76cc715c | [
"MIT"
] | null | null | null | from app.drivers.mslookup import base
from app.actions.mslookup import searchspace as preparation
from app.drivers.options import mslookup_options, sequence_options
from Bio import SeqIO
class SeqspaceLookupDriver(base.LookupDriver):
"""Creates an SQLite lookup DB from a FASTA file. Sequences are
trypsinized ... | 40.315789 | 153 | 0.665579 | from app.drivers.mslookup import base
from app.actions.mslookup import searchspace as preparation
from app.drivers.options import mslookup_options, sequence_options
from Bio import SeqIO
class SeqspaceLookupDriver(base.LookupDriver):
lookuptype = 'searchspace'
command = 'seqspace'
commandhelp = """Create ... | true | true |
f7f3f04f76fb3911a064e6d7ad1dc598333f95e2 | 61,546 | py | Python | release/stubs/Autodesk/Revit/DB/Lighting.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs/Autodesk/Revit/DB/Lighting.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs/Autodesk/Revit/DB/Lighting.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | # encoding: utf-8
# module Autodesk.Revit.DB.Lighting calls itself Lighting
# from RevitAPI, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class LossFactor(object, IDisposable):
""" This class is the base class for calculating... | 35.169143 | 321 | 0.627661 |
class LossFactor(object, IDisposable):
""" This class is the base class for calculating lighting loss factor. """
def Clone(self):
"""
Clone(self: LossFactor) -> LossFactor
Creates a copy of the LossFactor derived object.
"""
pass
... | false | true |
f7f3f1fa0c13dc06da409995111447a84e2e8c70 | 4,698 | py | Python | pandas/tests/test_common.py | Abishek15592/pandas | 6929e262dd22ac35baabf87a5236d451255fb66d | [
"BSD-3-Clause"
] | 1 | 2020-09-28T06:15:13.000Z | 2020-09-28T06:15:13.000Z | pandas/tests/test_common.py | Abishek15592/pandas | 6929e262dd22ac35baabf87a5236d451255fb66d | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/test_common.py | Abishek15592/pandas | 6929e262dd22ac35baabf87a5236d451255fb66d | [
"BSD-3-Clause"
] | 2 | 2021-07-17T19:28:31.000Z | 2021-11-28T17:14:58.000Z | import collections
from distutils.version import LooseVersion
from functools import partial
import string
import numpy as np
import pytest
from pandas.compat.numpy import np_version_under1p17
import pandas as pd
from pandas import Series, Timestamp
import pandas._testing as tm
from pandas.core import ops
import pand... | 27.635294 | 86 | 0.647935 | import collections
from distutils.version import LooseVersion
from functools import partial
import string
import numpy as np
import pytest
from pandas.compat.numpy import np_version_under1p17
import pandas as pd
from pandas import Series, Timestamp
import pandas._testing as tm
from pandas.core import ops
import pand... | true | true |
f7f3f202992ebedad65adc3a861bd6efc79ad33d | 40,679 | py | Python | stable_baselines3/common/policies.py | adbelniak/stable-baselines3 | 61e3b9c3fc4b113b5de65dd3b083de7550676018 | [
"MIT"
] | null | null | null | stable_baselines3/common/policies.py | adbelniak/stable-baselines3 | 61e3b9c3fc4b113b5de65dd3b083de7550676018 | [
"MIT"
] | null | null | null | stable_baselines3/common/policies.py | adbelniak/stable-baselines3 | 61e3b9c3fc4b113b5de65dd3b083de7550676018 | [
"MIT"
] | null | null | null | """Policies: abstract base class and concrete implementations."""
import collections
import copy
import warnings
from abc import ABC, abstractmethod
from functools import partial
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import gym
import numpy as np
import torch as th
from torch import nn
fro... | 41.679303 | 127 | 0.664667 |
import collections
import copy
import warnings
from abc import ABC, abstractmethod
from functools import partial
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import gym
import numpy as np
import torch as th
from torch import nn
from stable_baselines3.common.distributions import (
BernoulliDis... | true | true |
f7f3f49b4f097667b43331576493ca556c14c066 | 3,756 | py | Python | contrib/macdeploy/custom_dsstore.py | AnonymousGlobal/LegionCoin | d60a526513bc8c1ceba6664c30beb3fb01e30d46 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | AnonymousGlobal/LegionCoin | d60a526513bc8c1ceba6664c30beb3fb01e30d46 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | AnonymousGlobal/LegionCoin | d60a526513bc8c1ceba6664c30beb3fb01e30d46 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... | 62.6 | 1,817 | 0.727636 |
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': b'{{300, 280}, {500, 343}}',
'ContainerShowSidebar': False,
'S... | true | true |
f7f3f4a6ef998119d896425edb4bf5dadab229dc | 260 | py | Python | toga/platform/ios/widgets/__init__.py | r1chardj0n3s/toga | 76a8aa44854cac31c7c29d96a2717a711411cde0 | [
"BSD-3-Clause"
] | null | null | null | toga/platform/ios/widgets/__init__.py | r1chardj0n3s/toga | 76a8aa44854cac31c7c29d96a2717a711411cde0 | [
"BSD-3-Clause"
] | null | null | null | toga/platform/ios/widgets/__init__.py | r1chardj0n3s/toga | 76a8aa44854cac31c7c29d96a2717a711411cde0 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, absolute_import, division
from .button import Button
from .container import Container
from .label import Label
# from .splitview import SplitView
from .passwordinput import PasswordInput
from .textinput import TextInput
| 28.888889 | 64 | 0.842308 | from __future__ import print_function, absolute_import, division
from .button import Button
from .container import Container
from .label import Label
from .passwordinput import PasswordInput
from .textinput import TextInput
| true | true |
f7f3f4afba07be1f6beddad607c719ce06a0bde7 | 5,444 | py | Python | disqus/management/commands/disqus_export.py | alxpy/django-disqus | 2efa714d60cd2facd403720c908b089f70c97436 | [
"BSD-3-Clause"
] | 2 | 2015-09-24T19:53:14.000Z | 2015-11-06T10:46:16.000Z | disqus/management/commands/disqus_export.py | alxpy/django-disqus | 2efa714d60cd2facd403720c908b089f70c97436 | [
"BSD-3-Clause"
] | null | null | null | disqus/management/commands/disqus_export.py | alxpy/django-disqus | 2efa714d60cd2facd403720c908b089f70c97436 | [
"BSD-3-Clause"
] | 1 | 2020-03-05T18:44:55.000Z | 2020-03-05T18:44:55.000Z | from optparse import make_option
import os.path
from django.conf import settings
from django.contrib import comments
from django.contrib.sites.models import Site
from django.core.management.base import NoArgsCommand
from django.utils import simplejson as json
from disqus.api import DisqusClient
class Command(NoArgs... | 40.626866 | 80 | 0.579537 | from optparse import make_option
import os.path
from django.conf import settings
from django.contrib import comments
from django.contrib.sites.models import Site
from django.core.management.base import NoArgsCommand
from django.utils import simplejson as json
from disqus.api import DisqusClient
class Command(NoArgs... | false | true |
f7f3f4e9b956adc38c4ed469cfddee9e30679e04 | 466 | py | Python | src/mosaic_plot.py | LSchultebraucks/matplotlib_examples | cac02668ce6b81dcbbdf0ff3238cc01506c8f76a | [
"MIT"
] | null | null | null | src/mosaic_plot.py | LSchultebraucks/matplotlib_examples | cac02668ce6b81dcbbdf0ff3238cc01506c8f76a | [
"MIT"
] | null | null | null | src/mosaic_plot.py | LSchultebraucks/matplotlib_examples | cac02668ce6b81dcbbdf0ff3238cc01506c8f76a | [
"MIT"
] | null | null | null | import pandas as pd
from statsmodels.graphics.mosaicplot import mosaic
import pylab
from itertools import product
import numpy as np
rand = np.random.random
speaks_mul_foreign_languages = list(product(['male', 'female'], ['yes', 'no']))
index = pd.MultiIndex.from_tuples(speaks_mul_foreign_languages, names=['male', 'fe... | 33.285714 | 89 | 0.763948 | import pandas as pd
from statsmodels.graphics.mosaicplot import mosaic
import pylab
from itertools import product
import numpy as np
rand = np.random.random
speaks_mul_foreign_languages = list(product(['male', 'female'], ['yes', 'no']))
index = pd.MultiIndex.from_tuples(speaks_mul_foreign_languages, names=['male', 'fe... | true | true |
f7f3f580369c02c3d66ff981c817d42b4a3a6391 | 131,658 | py | Python | nova/tests/network/test_manager.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | 7 | 2017-06-19T19:37:00.000Z | 2019-06-16T02:06:14.000Z | nova/tests/network/test_manager.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | null | null | null | nova/tests/network/test_manager.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | 6 | 2015-06-20T16:07:28.000Z | 2020-08-19T14:57:59.000Z | # Copyright 2011 Rackspace
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2013 IBM Corp.
# 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
#
# ... | 45.446324 | 79 | 0.555021 |
import fixtures
import mock
import mox
import netaddr
from oslo.config import cfg
from oslo import messaging
from nova import context
from nova import db
from nova.db.sqlalchemy import models
from nova import exception
from nova import ipv6
from nova.network import floating_ips
from nova.network impor... | true | true |
f7f3f5eeff3574461e11fa3c225622d42a066c3a | 4,929 | py | Python | data/p3BR/R1/benchmark/startCirq436.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startCirq436.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startCirq436.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=3
# total number=80
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 42.128205 | 77 | 0.680665 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0]))
c.append(cirq.H.on(input_qubit[1]))
... | true | true |
f7f3f7600ee7f452e64da2ddbdd366dd2d8a0898 | 1,125 | py | Python | Python Fundamentals/Lists Advanced/Exercise/Task08_2.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | null | null | null | Python Fundamentals/Lists Advanced/Exercise/Task08_2.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | null | null | null | Python Fundamentals/Lists Advanced/Exercise/Task08_2.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | 1 | 2021-12-04T12:30:57.000Z | 2021-12-04T12:30:57.000Z | def first_letter_of_word(current_word):
digits = []
new_current_word = []
for letter in current_word:
if letter.isdigit():
digits.append(letter)
elif letter.isalpha():
new_current_word.append(letter)
first_letter = chr(int("".join(digits)))
new_current_word.in... | 25.568182 | 89 | 0.734222 | def first_letter_of_word(current_word):
digits = []
new_current_word = []
for letter in current_word:
if letter.isdigit():
digits.append(letter)
elif letter.isalpha():
new_current_word.append(letter)
first_letter = chr(int("".join(digits)))
new_current_word.in... | true | true |
f7f3f94a9ada53ecd58abcbd2140e0cdb83241af | 263 | py | Python | CRF-POS_NER/edit1.py | saivig/PGM | 04f27d7e2ea723bc3bd01b94e39a9ccc50130f5c | [
"Apache-2.0"
] | null | null | null | CRF-POS_NER/edit1.py | saivig/PGM | 04f27d7e2ea723bc3bd01b94e39a9ccc50130f5c | [
"Apache-2.0"
] | null | null | null | CRF-POS_NER/edit1.py | saivig/PGM | 04f27d7e2ea723bc3bd01b94e39a9ccc50130f5c | [
"Apache-2.0"
] | 2 | 2016-12-27T09:45:52.000Z | 2019-02-28T08:11:38.000Z | import sys
from itertools import izip
w=open(sys.argv[3],'w')
with open(sys.argv[1]) as r,open (sys.argv[2]) as o:
for line,line1 in izip(r,o):
if line.strip():
w.write(line.split("\n")[0]+" "+line1.split("\n")[0]+"\n")
else:
w.write("\n")
w.close();
| 21.916667 | 61 | 0.60076 | import sys
from itertools import izip
w=open(sys.argv[3],'w')
with open(sys.argv[1]) as r,open (sys.argv[2]) as o:
for line,line1 in izip(r,o):
if line.strip():
w.write(line.split("\n")[0]+" "+line1.split("\n")[0]+"\n")
else:
w.write("\n")
w.close();
| true | true |
f7f3fa1bec69a9a9b4ab1c57b6e7a9a0785a2410 | 431 | py | Python | ringlus/config/hr.py | momscode/ringlus | 9e217b21a37390a66cd772deecbbde4ad41ca74f | [
"MIT"
] | null | null | null | ringlus/config/hr.py | momscode/ringlus | 9e217b21a37390a66cd772deecbbde4ad41ca74f | [
"MIT"
] | 1 | 2021-09-17T07:16:16.000Z | 2021-09-17T07:16:16.000Z | ringlus/config/hr.py | momscode/ringlus | 9e217b21a37390a66cd772deecbbde4ad41ca74f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words
from frappe import _
def get_data():
return [
{
"label": _("Training"),
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
"name": "Trai... | 19.590909 | 95 | 0.591647 | from __future__ import unicode_literals
import frappe
from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words
from frappe import _
def get_data():
return [
{
"label": _("Training"),
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
"name": "Trai... | true | true |
f7f3fa3e486361ecae1c729a7ba8f0382d9506f8 | 3,374 | py | Python | charm-slurmd/src/utils.py | heitorPB/slurm-charms | 798ebc075a1ee7fb05abd9645de2c7e637a58de2 | [
"MIT"
] | null | null | null | charm-slurmd/src/utils.py | heitorPB/slurm-charms | 798ebc075a1ee7fb05abd9645de2c7e637a58de2 | [
"MIT"
] | null | null | null | charm-slurmd/src/utils.py | heitorPB/slurm-charms | 798ebc075a1ee7fb05abd9645de2c7e637a58de2 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""utils.py module for slurmd charm."""
import json
import os
import random
import subprocess
import sys
def lscpu():
"""Return lscpu as a python dictionary."""
def format_key(lscpu_key):
key_lower = lscpu_key.lower()
replace_hyphen = key_lower.replace("-", "_")
rep... | 26.992 | 84 | 0.599289 |
import json
import os
import random
import subprocess
import sys
def lscpu():
def format_key(lscpu_key):
key_lower = lscpu_key.lower()
replace_hyphen = key_lower.replace("-", "_")
replace_lparen = replace_hyphen.replace("(", "")
replace_rparen = replace_lparen.replace(")", "")
... | true | true |
f7f3fb2d42c9ba6da672a5b408ec3126e3d3d688 | 3,341 | py | Python | data-generation-GAN/generate_samples_market.py | lulujianjie/efficient-person-generation-for-reid | 1bb29c7c280e3322a65af36b37deecbce0c1d322 | [
"RSA-MD"
] | 24 | 2020-04-27T01:53:02.000Z | 2020-09-09T04:39:31.000Z | data-generation-GAN/generate_samples_market.py | lulujianjie/efficient-person-generation-for-reID | 1bb29c7c280e3322a65af36b37deecbce0c1d322 | [
"RSA-MD"
] | 8 | 2020-09-27T04:55:10.000Z | 2021-11-25T02:31:09.000Z | data-generation-GAN/generate_samples_market.py | lulujianjie/efficient-person-generation-for-reID | 1bb29c7c280e3322a65af36b37deecbce0c1d322 | [
"RSA-MD"
] | 8 | 2020-04-27T01:54:24.000Z | 2022-02-05T06:21:20.000Z | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import os
import sys
import cv2
from config.cfg import Cfg
import torch
from torch.backends import cudnn
from datasets.bases import read_image
sys.path.append('.')
from datasets import make_dataloader
from processor import do_inference
from model import make_model
from ... | 28.07563 | 120 | 0.662975 |
import os
import sys
import cv2
from config.cfg import Cfg
import torch
from torch.backends import cudnn
from datasets.bases import read_image
sys.path.append('.')
from datasets import make_dataloader
from processor import do_inference
from model import make_model
from utils.logger import setup_logger
import torc... | true | true |
f7f3fb3bbb21d6216179e9f85c140b3fce8ce0fe | 2,943 | py | Python | cpo/lib/fyre/request_managers/ocp_add_additional_nodes_put_manager.py | IBM/data-gate-cli | fc0cb1a560a0156c71eb63a550e198d0cd36e1df | [
"Apache-2.0"
] | 9 | 2020-08-21T08:46:34.000Z | 2021-09-02T15:47:41.000Z | cpo/lib/fyre/request_managers/ocp_add_additional_nodes_put_manager.py | IBM/data-gate-cli | fc0cb1a560a0156c71eb63a550e198d0cd36e1df | [
"Apache-2.0"
] | 10 | 2020-11-26T15:31:43.000Z | 2021-11-08T15:00:01.000Z | cpo/lib/fyre/request_managers/ocp_add_additional_nodes_put_manager.py | IBM/data-gate-cli | fc0cb1a560a0156c71eb63a550e198d0cd36e1df | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 IBM 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... | 32.7 | 107 | 0.616718 |
from typing import Any, Final, Optional
from cpo.lib.fyre.request_managers.json_request_manager import (
AbstractJSONRequestManager,
)
from cpo.lib.fyre.response_managers.default_response_manager import (
DefaultResponseManager,
)
from cpo.lib.fyre.response_managers.json_response_manager import (... | true | true |
f7f3fef09cd2f28eebfa59a293c707414824ec6e | 7,054 | py | Python | run/design.py | ottj3/weboligos | 96d8ff00634cbd166384d3b5ac8e5a2e9b0d5ba9 | [
"MIT"
] | null | null | null | run/design.py | ottj3/weboligos | 96d8ff00634cbd166384d3b5ac8e5a2e9b0d5ba9 | [
"MIT"
] | 1 | 2020-07-06T23:58:59.000Z | 2020-07-06T23:58:59.000Z | run/design.py | ottj3/weboligos | 96d8ff00634cbd166384d3b5ac8e5a2e9b0d5ba9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 24 11:36:17 2011
@author: ryan
"""
import numpy as np
import sys
class Acid:
def __init__(self, name, p, segsize, overlapsize, minval, maxval, numpts):
self.designtype = self.compute_design_type(numpts)
self.locations = self.compute_locations(name, p... | 37.521277 | 113 | 0.641338 |
"""
Created on Wed Aug 24 11:36:17 2011
@author: ryan
"""
import numpy as np
import sys
class Acid:
def __init__(self, name, p, segsize, overlapsize, minval, maxval, numpts):
self.designtype = self.compute_design_type(numpts)
self.locations = self.compute_locations(name, p)
self.required... | false | true |
f7f3ff3c80632f36fbccacd0f3d3e08bd6dbf839 | 15,148 | py | Python | numba/tests/test_cfunc.py | tolysz/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | numba/tests/test_cfunc.py | tolysz/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | 1 | 2019-02-11T13:46:30.000Z | 2019-02-11T13:46:30.000Z | numba/tests/test_cfunc.py | asodeur/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | """
Tests for @cfunc and friends.
"""
import ctypes
import os
import subprocess
import sys
from collections import namedtuple
import numpy as np
from numba import unittest_support as unittest
from numba import cfunc, carray, farray, types, typing, utils, njit
from numba import cffi_support, numpy_support
from .supp... | 32.298507 | 84 | 0.613414 |
import ctypes
import os
import subprocess
import sys
from collections import namedtuple
import numpy as np
from numba import unittest_support as unittest
from numba import cfunc, carray, farray, types, typing, utils, njit
from numba import cffi_support, numpy_support
from .support import TestCase, tag, captured_std... | true | true |
f7f3ffb2c7c4d6f598324352077c884c06a2a7af | 1,092 | py | Python | backend/apps/organizations/migrations/0031_auto_20210824_1446.py | hovedstyret/indok-web | 598e9ca0b5f3a5e776a85dec0a8694b9bcd5a159 | [
"MIT"
] | 3 | 2021-11-18T09:29:14.000Z | 2022-01-13T20:12:11.000Z | backend/apps/organizations/migrations/0031_auto_20210824_1446.py | rubberdok/indok-web | 598e9ca0b5f3a5e776a85dec0a8694b9bcd5a159 | [
"MIT"
] | 277 | 2022-01-17T18:16:44.000Z | 2022-03-31T19:44:04.000Z | backend/apps/organizations/migrations/0031_auto_20210824_1446.py | hovedstyret/indok-web | 598e9ca0b5f3a5e776a85dec0a8694b9bcd5a159 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.8 on 2021-08-24 12:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("permissions", "0003_auto_20210824_1213"),
("organizations", "0030_auto_20210426_2129"),
]
operations = [
... | 28.736842 | 63 | 0.555861 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("permissions", "0003_auto_20210824_1213"),
("organizations", "0030_auto_20210426_2129"),
]
operations = [
migrations.AlterField(
model_... | true | true |
f7f3ffc2f7a6b7908955cf5463872a24feb9f6af | 4,933 | py | Python | roles/cloudera_manager/api_client/action_plugins/cm_api.py | scigility/cloudera.cluster | 474afce28ab52afe5f828f16647760a14b1c350f | [
"Apache-2.0"
] | 15 | 2021-04-23T18:21:52.000Z | 2022-02-02T17:40:59.000Z | roles/cloudera_manager/api_client/action_plugins/cm_api.py | scigility/cloudera.cluster | 474afce28ab52afe5f828f16647760a14b1c350f | [
"Apache-2.0"
] | 28 | 2021-04-29T06:43:25.000Z | 2022-03-23T09:11:54.000Z | roles/cloudera_manager/api_client/action_plugins/cm_api.py | scigility/cloudera.cluster | 474afce28ab52afe5f828f16647760a14b1c350f | [
"Apache-2.0"
] | 28 | 2021-05-04T19:02:33.000Z | 2022-03-18T17:17:46.000Z | # Copyright 2021 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 41.805085 | 127 | 0.702818 |
from ansible.plugins.action import ActionBase
from ansible.errors import AnsibleError
from ansible.utils.display import Display
import time
display = Display()
class ActionModule(ActionBase):
def build_url(self, api_base, api_endpoint):
if not api_endpoint.startswith("/"):
api_endpoint = "... | true | true |
f7f3ffd47462052d06432704374f30c8e1fef9c1 | 6,918 | py | Python | nextdl/extractor/telecinco.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | 1 | 2021-12-19T13:55:20.000Z | 2021-12-19T13:55:20.000Z | nextdl/extractor/telecinco.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | nextdl/extractor/telecinco.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..utils import clean_html, int_or_none, str_or_none, try_get
from .common import InfoExtractor
class TelecincoIE(InfoExtractor):
IE_DESC = "telecinco.es, cuatro.com and mediaset.es"
_VALID_URL = r"https?://(?:www\.)?(?:teleci... | 38.865169 | 149 | 0.506794 |
from __future__ import unicode_literals
import json
import re
from ..utils import clean_html, int_or_none, str_or_none, try_get
from .common import InfoExtractor
class TelecincoIE(InfoExtractor):
IE_DESC = "telecinco.es, cuatro.com and mediaset.es"
_VALID_URL = r"https?://(?:www\.)?(?:telecinco\.es|cuatro\... | true | true |
f7f4016336e7fd132d59a863b69b891712c34873 | 30,376 | py | Python | main.py | Chereq/bomberman | e715bd1a70c92c88b25a09e208933bedd2eb5679 | [
"MIT"
] | null | null | null | main.py | Chereq/bomberman | e715bd1a70c92c88b25a09e208933bedd2eb5679 | [
"MIT"
] | null | null | null | main.py | Chereq/bomberman | e715bd1a70c92c88b25a09e208933bedd2eb5679 | [
"MIT"
] | 1 | 2021-12-25T13:40:06.000Z | 2021-12-25T13:40:06.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame as pg
from pygame import sprite
from itertools import cycle
from random import randint
# for field
BLOCK_WIDTH = 32
BLOCK_HEIGHT = 32
WIN_WIDTH = 800 # BLOCK_WIDTH * 8
WIN_HEIGHT = 600 # BLOCK_HEIGHT * 8
DISPLAY = (WIN_WIDTH, WIN_HEIGHT)
BACKGROUND_COLOR =... | 34.955121 | 79 | 0.52637 |
import pygame as pg
from pygame import sprite
from itertools import cycle
from random import randint
BLOCK_WIDTH = 32
BLOCK_HEIGHT = 32
WIN_WIDTH = 800
WIN_HEIGHT = 600
DISPLAY = (WIN_WIDTH, WIN_HEIGHT)
BACKGROUND_COLOR = "#388700"
BLOCK_COLOR = "#b0b0b0"
MOVE_SPEED = BLOCK_WIDTH // 8
WIDTH = BLOCK_WIDTH
HEI... | true | true |
f7f401d2b6f697e2ed274730ba40d1ab0365c3b3 | 2,243 | py | Python | functions/source/KeyGen/cryptography/hazmat/primitives/hmac.py | kenmoini/aws-quickstart-centos-okd | 1e9daf4e283550e4ed240913352b0283ace6568d | [
"Apache-2.0"
] | 179 | 2017-09-13T20:52:00.000Z | 2022-03-24T19:18:19.000Z | functions/source/KeyGen/cryptography/hazmat/primitives/hmac.py | kenmoini/aws-quickstart-centos-okd | 1e9daf4e283550e4ed240913352b0283ace6568d | [
"Apache-2.0"
] | 248 | 2017-09-13T20:11:40.000Z | 2022-03-30T07:30:40.000Z | functions/source/KeyGen/cryptography/hazmat/primitives/hmac.py | kenmoini/aws-quickstart-centos-okd | 1e9daf4e283550e4ed240913352b0283ace6568d | [
"Apache-2.0"
] | 216 | 2017-09-14T19:46:22.000Z | 2022-03-29T22:19:20.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
... | 32.985294 | 79 | 0.660722 |
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
AlreadyFinalized, UnsupportedAlgorithm, _Reasons
)
from cryptography.hazmat.backends.interfaces import HMACBackend
from cryptography.hazmat.primitives import hashes, mac
@util... | true | true |
f7f4023fa434b12507d2de3f4e9836ed73c49624 | 1,110 | py | Python | Intro to Python for Data Science/Python Lists/slicing-and-dicing.py | nazmusshakib121/Python-Programming | 3ea852641cd5fe811228f27a780109a44174e8e5 | [
"MIT"
] | 3 | 2019-05-12T04:49:24.000Z | 2020-05-06T00:40:28.000Z | Intro to Python for Data Science/Python Lists/slicing-and-dicing.py | nazmusshakib121/Python-Programming | 3ea852641cd5fe811228f27a780109a44174e8e5 | [
"MIT"
] | null | null | null | Intro to Python for Data Science/Python Lists/slicing-and-dicing.py | nazmusshakib121/Python-Programming | 3ea852641cd5fe811228f27a780109a44174e8e5 | [
"MIT"
] | 7 | 2018-11-06T17:43:31.000Z | 2020-11-07T21:08:16.000Z | '''
Slicing and dicing
100xp
Selecting single values from a list is just one part of the story. It's also possible to slice your
list, which means selecting multiple elements from your list. Use the following syntax:
my_list[start:end]
The start index will be included, while the end index is not.
The code sample belo... | 32.647059 | 100 | 0.741441 |
areas = ["hallway", 11.25, "kitchen", 18.0, "living room", 20.0, "bedroom", 10.75, "bathroom", 9.50]
downstairs = areas[0:6]
upstairs = areas[6:]
print(downstairs)
print(upstairs)
| true | true |
f7f4025ce0321b5a22101355a0d2f41823d0cfe3 | 9,738 | py | Python | wrappers/python_2-7/WPWithinWrapperImpl.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | wrappers/python_2-7/WPWithinWrapperImpl.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | wrappers/python_2-7/WPWithinWrapperImpl.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | #!/usr/bin/python
import ServiceAdapter
import EventServer
import rpc
import wpthrift_types
from wpwithin.WPWithin import Client
from wpthrift_types import ttypes
from wpthrift_types.ttypes import ServiceDeliveryToken
import time
import thrift
from thrift import Thrift
from thrift.transport import TSocket
from thrift.... | 48.447761 | 235 | 0.686999 |
import ServiceAdapter
import EventServer
import rpc
import wpthrift_types
from wpwithin.WPWithin import Client
from wpthrift_types import ttypes
from wpthrift_types.ttypes import ServiceDeliveryToken
import time
import thrift
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import ... | false | true |
f7f40266108734e488bf6670581e5a7754f2cfd7 | 57 | py | Python | elastipy/_version.py | defgsus/elastipy | c1144ab39fa70571ba0e02ccf41d380a8a1bd730 | [
"Apache-2.0"
] | 1 | 2021-02-17T17:50:28.000Z | 2021-02-17T17:50:28.000Z | elastipy/_version.py | defgsus/elastipy | c1144ab39fa70571ba0e02ccf41d380a8a1bd730 | [
"Apache-2.0"
] | 2 | 2021-03-29T02:09:41.000Z | 2022-03-01T20:09:48.000Z | elastipy/_version.py | netzkolchose/elastipy | c1144ab39fa70571ba0e02ccf41d380a8a1bd730 | [
"Apache-2.0"
] | null | null | null |
version = (0, 2, 1)
version_str = "%s.%s.%s" % version
| 11.4 | 34 | 0.54386 |
version = (0, 2, 1)
version_str = "%s.%s.%s" % version
| true | true |
f7f40382e836232034c37a7874a726c1592832e8 | 1,568 | py | Python | Configuration/Geometry/python/GeometryRecoDB_cff.py | scodella/cmssw | 974479b50b19bd795cb5f91eac872857fd6290f6 | [
"Apache-2.0"
] | 1 | 2021-04-13T13:26:16.000Z | 2021-04-13T13:26:16.000Z | Configuration/Geometry/python/GeometryRecoDB_cff.py | scodella/cmssw | 974479b50b19bd795cb5f91eac872857fd6290f6 | [
"Apache-2.0"
] | null | null | null | Configuration/Geometry/python/GeometryRecoDB_cff.py | scodella/cmssw | 974479b50b19bd795cb5f91eac872857fd6290f6 | [
"Apache-2.0"
] | 1 | 2020-04-01T15:30:45.000Z | 2020-04-01T15:30:45.000Z | import FWCore.ParameterSet.Config as cms
# Tracking Geometry
from Geometry.CommonDetUnit.globalTrackingGeometryDB_cfi import *
#Tracker
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *
#Muon
from RecoMuon.DetLayers.muon... | 41.263158 | 100 | 0.876913 | import FWCore.ParameterSet.Config as cms
from Geometry.CommonDetUnit.globalTrackingGeometryDB_cfi import *
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *
f... | true | true |
f7f403942c227694871c6399aa18bc9ec5dc56b6 | 6,736 | py | Python | ingestion/tests/integration/ometa/test_ometa_lineage_api.py | ulixius9/OpenMetadata | f121698d968717f0932f685ef2a512c2a4d92438 | [
"Apache-2.0"
] | null | null | null | ingestion/tests/integration/ometa/test_ometa_lineage_api.py | ulixius9/OpenMetadata | f121698d968717f0932f685ef2a512c2a4d92438 | [
"Apache-2.0"
] | null | null | null | ingestion/tests/integration/ometa/test_ometa_lineage_api.py | ulixius9/OpenMetadata | f121698d968717f0932f685ef2a512c2a4d92438 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Collate
# 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... | 33.346535 | 99 | 0.674436 |
from unittest import TestCase
from metadata.generated.schema.api.data.createDatabase import CreateDatabaseRequest
from metadata.generated.schema.api.data.createDatabaseSchema import (
CreateDatabaseSchemaRequest,
)
from metadata.generated.schema.api.data.createPipeline import CreatePipelineRequest
from ... | true | true |
f7f403dd541a967bd6ecfcc97776553f0f776531 | 2,062 | py | Python | api/views.py | xhackax47/AXEL_WEB | 917cdbdd79ae364327135e09abce9d058dc1271a | [
"MIT"
] | 1 | 2020-01-17T10:51:21.000Z | 2020-01-17T10:51:21.000Z | api/views.py | xhackax47/AXEL_WEB | 917cdbdd79ae364327135e09abce9d058dc1271a | [
"MIT"
] | 8 | 2021-03-30T12:35:54.000Z | 2022-03-12T00:11:34.000Z | api/views.py | xhackax47/AXEL_WEB | 917cdbdd79ae364327135e09abce9d058dc1271a | [
"MIT"
] | null | null | null | from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.viewsets import ModelViewSet
from WebAXEL.models import Robot, Document, DataSet
from api.serializers import RobotSerializer, DocumentSerializer, DataSetSerializer
# DOCUMENTS
# Vue DocumentListView qui renvoi la... | 31.242424 | 83 | 0.803104 | from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.viewsets import ModelViewSet
from WebAXEL.models import Robot, Document, DataSet
from api.serializers import RobotSerializer, DocumentSerializer, DataSetSerializer
class DocumentListView(ListCreateAPIView):
... | true | true |
f7f404274ce59c8d6649c8898cfb73c869ca450c | 1,214 | py | Python | Python/PythonFundamentals/TypeList.py | JosephAMumford/CodingDojo | 505be74d18d7a8f41c4b3576ca050b97f840f0a3 | [
"MIT"
] | 2 | 2018-08-18T15:14:45.000Z | 2019-10-16T16:14:13.000Z | Python/PythonFundamentals/TypeList.py | JosephAMumford/CodingDojo | 505be74d18d7a8f41c4b3576ca050b97f840f0a3 | [
"MIT"
] | null | null | null | Python/PythonFundamentals/TypeList.py | JosephAMumford/CodingDojo | 505be74d18d7a8f41c4b3576ca050b97f840f0a3 | [
"MIT"
] | 6 | 2018-05-05T18:13:05.000Z | 2021-05-20T11:32:48.000Z | #input
l = ['magical unicorns',19,'hello',98.98,'world']
# l = [2,3,1,7,4,12]
# l = ['magical','unicorns']
# l = [2, 3.14, 5.8, 5]
# variables
string = ""
totalInt = 0
totalFloat = 0
sumTotal = 0
# loop through list to evaluate element types
# and add like values together
for value in l:
if isinstance(value, base... | 28.904762 | 58 | 0.630972 |
l = ['magical unicorns',19,'hello',98.98,'world']
string = ""
totalInt = 0
totalFloat = 0
sumTotal = 0
for value in l:
if isinstance(value, basestring):
string += " " + value
if isinstance(value, int):
totalInt += value
if isinstance(value, float):
totalFloat += value
sum... | false | true |
f7f4046b0b74d33b3a17925148de5aed2198a690 | 4,474 | py | Python | sdk/communication/azure-communication-chat/azure/communication/chat/_shared/utils.py | romahamu/azure-sdk-for-python | a57c9f73b9121f79d317e1679b81fd460d6a25b8 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/communication/azure-communication-chat/azure/communication/chat/_shared/utils.py | RSidea/azure-sdk-for-python | 8f691b2c95ee0fc53b12d08bd83e3f134d9cf0ef | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-chat/azure/communication/chat/_shared/utils.py | RSidea/azure-sdk-for-python | 8f691b2c95ee0fc53b12d08bd83e3f134d9cf0ef | [
"MIT"
] | 1 | 2021-12-18T20:01:22.000Z | 2021-12-18T20:01:22.000Z | # ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
import base... | 37.915254 | 119 | 0.669647 |
import base64
import json
import time
from typing import (
cast,
Tuple,
)
from datetime import datetime
from msrest.serialization import TZ_UTC
from azure.core.credentials import AccessToken
def _convert_datetime_to_utc_int(expires_on):
epoch = time.mktime(datetime(1970, 1, 1).timetuple())
ret... | true | true |
f7f404935e8dd9b8574f2148df5c0fc153ef1585 | 699 | py | Python | bs_jobs_rate.py | tsaavik/beanstalk-munin | 2b04ce4ae7a18de873fcde4d6846042a8e68b188 | [
"Apache-2.0"
] | 15 | 2015-03-22T21:05:18.000Z | 2018-10-05T08:19:30.000Z | bs_jobs_rate.py | tsaavik/beanstalk-munin | 2b04ce4ae7a18de873fcde4d6846042a8e68b188 | [
"Apache-2.0"
] | 1 | 2015-05-18T12:09:19.000Z | 2017-04-18T12:42:43.000Z | bs_jobs_rate.py | tsaavik/beanstalk-munin | 2b04ce4ae7a18de873fcde4d6846042a8e68b188 | [
"Apache-2.0"
] | 6 | 2015-12-18T11:41:46.000Z | 2021-05-13T07:13:31.000Z | #!/usr/bin/env python
import os
import sys
import beanstalkc
HOST = os.environ.get('HOST', 'localhost')
PORT = os.environ.get('PORT', 11300)
def do_data():
stats = beanstalkc.Connection(HOST, PORT).stats()
print 'queue_jobs.value %d' % stats['total-jobs']
def do_config():
print "graph_title Job Rate"
... | 24.103448 | 53 | 0.663805 |
import os
import sys
import beanstalkc
HOST = os.environ.get('HOST', 'localhost')
PORT = os.environ.get('PORT', 11300)
def do_data():
stats = beanstalkc.Connection(HOST, PORT).stats()
print 'queue_jobs.value %d' % stats['total-jobs']
def do_config():
print "graph_title Job Rate"
print "graph_vlabel ... | false | true |
f7f4055c13196fe1f487a72caee8946af8b7aaac | 2,316 | py | Python | setup.py | taylor-a-barnes/quantum_espresso_step | fac8b35b9bc6c993cb0e2f54c4f82fb6f5f75985 | [
"BSD-3-Clause"
] | null | null | null | setup.py | taylor-a-barnes/quantum_espresso_step | fac8b35b9bc6c993cb0e2f54c4f82fb6f5f75985 | [
"BSD-3-Clause"
] | null | null | null | setup.py | taylor-a-barnes/quantum_espresso_step | fac8b35b9bc6c993cb0e2f54c4f82fb6f5f75985 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'molssi_workflow>=0.1',
'mol... | 32.166667 | 106 | 0.656736 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'molssi_workflow>=0.1',
'molssi_util>=0.1'
]
setup_requirements = [
'pytest-runner',
... | true | true |
f7f4065398028e667b2efb676dfbae3d43f5e22b | 10,068 | py | Python | docs/conf.py | phst/commonmark.py | d031003aa23cfce1787cfb29c1eb109b369ca5b7 | [
"BSD-3-Clause"
] | 154 | 2015-12-10T23:17:28.000Z | 2019-04-04T06:49:36.000Z | docs/conf.py | phst/commonmark.py | d031003aa23cfce1787cfb29c1eb109b369ca5b7 | [
"BSD-3-Clause"
] | 131 | 2019-07-02T15:56:33.000Z | 2022-03-25T19:54:02.000Z | docs/conf.py | phst/commonmark.py | d031003aa23cfce1787cfb29c1eb109b369ca5b7 | [
"BSD-3-Clause"
] | 53 | 2015-12-08T18:06:51.000Z | 2019-05-02T18:08:10.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# commonmark.py documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 4 18:11:52 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in thi... | 32.269231 | 98 | 0.715236 |
import sys
import os
import shlex
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'commonmark.py'
copyright = '2014-2019, Roland ... | true | true |
f7f407943f46ec7c3364c5ef91bffe981be63399 | 658 | py | Python | src/models/configuration.py | lokarithm/PyWebTest | a8c3e0563216f4ef0ec451eea2bed18f283e668f | [
"MIT"
] | null | null | null | src/models/configuration.py | lokarithm/PyWebTest | a8c3e0563216f4ef0ec451eea2bed18f283e668f | [
"MIT"
] | 1 | 2021-08-22T22:14:59.000Z | 2021-08-22T22:14:59.000Z | src/models/configuration.py | lokarithm/PyWebTest | a8c3e0563216f4ef0ec451eea2bed18f283e668f | [
"MIT"
] | null | null | null | from .user import User
class Configuration:
def __init__(self, url):
self.url = url
self._user = None
self._testCase = None
self._is_headless = False
@property
def is_headless(self):
return self._is_headless
@property
def testCase(self):
return sel... | 19.352941 | 39 | 0.620061 | from .user import User
class Configuration:
def __init__(self, url):
self.url = url
self._user = None
self._testCase = None
self._is_headless = False
@property
def is_headless(self):
return self._is_headless
@property
def testCase(self):
return sel... | true | true |
f7f407eac0f02726724a43cf801abe1145d7ae18 | 40,690 | py | Python | saleor/lib/python3.7/site-packages/graphql/language/ast.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | 2 | 2019-06-27T22:05:59.000Z | 2021-06-04T09:02:02.000Z | saleor/lib/python3.7/site-packages/graphql/language/ast.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | 5 | 2020-03-24T16:37:25.000Z | 2021-06-10T21:24:54.000Z | saleor/lib/python3.7/site-packages/graphql/language/ast.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | 1 | 2019-02-21T00:41:13.000Z | 2019-02-21T00:41:13.000Z | # Necessary for static type checking
if False: # flake8: noqa
from .parser import Loc
from typing import Any, Optional, Union, List, Tuple, Iterable
# This is autogenerated code. DO NOT change this manually.
# Run scripts/generate_ast.py to generate this file.
class Node(object):
__slots__ = ()
_fie... | 27.126667 | 88 | 0.529958 |
if False:
from .parser import Loc
from typing import Any, Optional, Union, List, Tuple, Iterable
class Node(object):
__slots__ = ()
_fields = ()
loc = None
class Definition(Node):
__slots__ = ()
class Document(Node):
__slots__ = ("loc", "definitions")
_fields = ("definiti... | true | true |
f7f40856105d83356e23b95542fae1bcd226d565 | 1,825 | py | Python | stubs.min/Autodesk/Revit/DB/__init___parts/PlanTopologySetIterator.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/Autodesk/Revit/DB/__init___parts/PlanTopologySetIterator.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/Autodesk/Revit/DB/__init___parts/PlanTopologySetIterator.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class PlanTopologySetIterator(APIObject,IDisposable,IEnumerator):
"""
An iterator to a set of plan topology objects.
PlanTopologySetIterator()
"""
def Dispose(self):
""" Dispose(self: PlanTopologySetIterator,A_0: bool) """
pass
def MoveNext(self):
"""
MoveNext(self: PlanTopologySetIterator)... | 32.017544 | 215 | 0.683836 | class PlanTopologySetIterator(APIObject,IDisposable,IEnumerator):
pass
"""
MoveNext(self: PlanTopologySetIterator) -> bool
pass
def Reset(self):
Reset(self: PlanTopologySetIterator)
Bring the iterator back to the start of the set.
pass
def __enter__(self,*args):
pass
def __exit__(self,*... | true | true |
f7f40a66af9c633a83d4a5c5cc759a9f77018898 | 5,619 | py | Python | pandas/core/computation/align.py | BenRussert/pandas | 9179e633b1e54ac31c5ea42ec0ec24e9a1709aae | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2018-11-11T22:18:13.000Z | 2018-11-11T22:18:13.000Z | pandas/core/computation/align.py | dkenward/pandas | 1f02bf240c3d0d3da338af868d056bfc169b28c2 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/computation/align.py | dkenward/pandas | 1f02bf240c3d0d3da338af868d056bfc169b28c2 | [
"BSD-3-Clause"
] | 1 | 2021-06-21T07:51:29.000Z | 2021-06-21T07:51:29.000Z | """Core eval alignment algorithms
"""
from functools import partial, wraps
import warnings
import numpy as np
from pandas.compat import range, zip
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import compat
import pandas.core.common as com
from pandas.core.computation.common import _r... | 31.044199 | 79 | 0.618259 |
from functools import partial, wraps
import warnings
import numpy as np
from pandas.compat import range, zip
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import compat
import pandas.core.common as com
from pandas.core.computation.common import _result_type_many
def _align_core_sing... | true | true |
f7f40a8dda9cbb10b4b472a35088ca5e7e3ece68 | 5,376 | py | Python | jrnl/exporters.py | NicholasMerrill/jrnl-todos | 142b794296e6249b698a4e53ce30ef376b560960 | [
"MIT"
] | null | null | null | jrnl/exporters.py | NicholasMerrill/jrnl-todos | 142b794296e6249b698a4e53ce30ef376b560960 | [
"MIT"
] | null | null | null | jrnl/exporters.py | NicholasMerrill/jrnl-todos | 142b794296e6249b698a4e53ce30ef376b560960 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
import os
import json
from .util import u, slugify
import codecs
def get_tags_count(journal):
"""Returns a set of tuples (count, tag) for all tags present in the journal."""
# Astute reader: should the following ... | 32.780488 | 105 | 0.606399 |
from __future__ import absolute_import, unicode_literals
import os
import json
from .util import u, slugify
import codecs
def get_tags_count(journal):
tags = [tag
for entry in journal.entries
for tag in set(entry.tags)]
tag_counts = set([(tags.count(tag), tag) for tag... | true | true |
f7f40aed8d52892ecdb16a5d795e66aff2c5c08e | 831 | py | Python | userbot/plugins/pin.py | znotash/X-tra-Telegram | cd301ffc09a1c56102555eb0562940f290002018 | [
"MIT"
] | 2 | 2020-05-14T07:48:09.000Z | 2020-05-14T07:48:51.000Z | userbot/plugins/pin.py | znotash/X-tra-Telegram | cd301ffc09a1c56102555eb0562940f290002018 | [
"MIT"
] | null | null | null | userbot/plugins/pin.py | znotash/X-tra-Telegram | cd301ffc09a1c56102555eb0562940f290002018 | [
"MIT"
] | 2 | 2020-06-12T12:51:09.000Z | 2020-06-16T13:44:25.000Z | """Pins the replied message
Syntax: .cpin [LOUD]"""
from telethon import events
from telethon.tl import functions, types
from userbot.utils import admin_cmd
@borg.on(admin_cmd("cpin ?(.*)"))
async def _(event):
if event.fwd_from:
return
silent = True
input_str = event.pattern_match.group(1)
if... | 27.7 | 69 | 0.604091 | from telethon import events
from telethon.tl import functions, types
from userbot.utils import admin_cmd
@borg.on(admin_cmd("cpin ?(.*)"))
async def _(event):
if event.fwd_from:
return
silent = True
input_str = event.pattern_match.group(1)
if input_str:
silent = False
if event.mess... | true | true |
f7f40b7b8a58b5ea5e1b0559ff5845f8a641f7ef | 702,671 | py | Python | tests/examples/minlplib/chp_shorttermplan2c.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/chp_shorttermplan2c.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/chp_shorttermplan2c.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 04/21/18 13:51:15
#
# Equation counts
# Total E G L N X C B
# 6735 97 816 5822 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 40.120532 | 120 | 0.623965 |
from pyomo.environ import *
model = m = ConcreteModel()
m.x2 = Var(within=Reals,bounds=(0,45),initialize=0)
m.x3 = Var(within=Reals,bounds=(0,45),initialize=0)
m.x4 = Var(within=Reals,bounds=(0,45),initialize=0)
m.x5 = Var(within=Reals,bounds=(0,45),initialize=0)
m.x6 = Var(within=Reals,bounds=(0,... | true | true |
f7f40c68fac122d3e85f8d9ae7c03226d8a2af0c | 6,010 | py | Python | env/lib/python3.5/site-packages/notebook/tests/launchnotebook.py | riordan/who-owns-what | 62538fdb6d40ed1e0cdafb0df388be95fb388907 | [
"Apache-2.0"
] | null | null | null | env/lib/python3.5/site-packages/notebook/tests/launchnotebook.py | riordan/who-owns-what | 62538fdb6d40ed1e0cdafb0df388be95fb388907 | [
"Apache-2.0"
] | 3 | 2020-03-24T15:38:23.000Z | 2021-02-02T21:44:18.000Z | env/lib/python3.5/site-packages/notebook/tests/launchnotebook.py | riordan/who-owns-what | 62538fdb6d40ed1e0cdafb0df388be95fb388907 | [
"Apache-2.0"
] | 1 | 2017-03-16T22:39:47.000Z | 2017-03-16T22:39:47.000Z | """Base class for notebook tests."""
from __future__ import print_function
from binascii import hexlify
import os
import time
import requests
from contextlib import contextmanager
from threading import Thread, Event
from unittest import TestCase
pjoin = os.path.join
try:
from unittest.mock import patch
except I... | 33.764045 | 104 | 0.615474 |
from __future__ import print_function
from binascii import hexlify
import os
import time
import requests
from contextlib import contextmanager
from threading import Thread, Event
from unittest import TestCase
pjoin = os.path.join
try:
from unittest.mock import patch
except ImportError:
from mock import patc... | true | true |
f7f40cb92f7844d5e4459018167575f915d6b74f | 2,068 | py | Python | homeassistant/components/template/__init__.py | pszafer/core | ab6fb5cb7705a7f2e3a4f310b5d42047c3372bd2 | [
"Apache-2.0"
] | 1 | 2018-04-24T21:48:14.000Z | 2018-04-24T21:48:14.000Z | homeassistant/components/template/__init__.py | pszafer/core | ab6fb5cb7705a7f2e3a4f310b5d42047c3372bd2 | [
"Apache-2.0"
] | 44 | 2020-08-03T07:31:07.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/template/__init__.py | jeroen84/home-assistant | a47f73244c0b3fbe4210ffd7731be69b3984fbbd | [
"Apache-2.0"
] | 2 | 2017-09-03T16:06:02.000Z | 2021-01-12T15:07:52.000Z | """The template component."""
import logging
from homeassistant import config as conf_util
from homeassistant.const import SERVICE_RELOAD
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_per_platform, entity_platform
from homeassistant.loader import async_get_integratio... | 30.865672 | 88 | 0.704545 |
import logging
from homeassistant import config as conf_util
from homeassistant.const import SERVICE_RELOAD
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_per_platform, entity_platform
from homeassistant.loader import async_get_integration
from .const import DOMAIN, ... | true | true |
f7f40e9486aeefb8fa290e4eaa997d3668287691 | 3,543 | py | Python | src/reports/grades_report.py | KanegaeGabriel/sisu-data | a92fe3a21922c7036add7eaf92264d6953eec133 | [
"MIT"
] | null | null | null | src/reports/grades_report.py | KanegaeGabriel/sisu-data | a92fe3a21922c7036add7eaf92264d6953eec133 | [
"MIT"
] | null | null | null | src/reports/grades_report.py | KanegaeGabriel/sisu-data | a92fe3a21922c7036add7eaf92264d6953eec133 | [
"MIT"
] | null | null | null | import csv
import sys
import os
with open('short_category_names.txt', encoding='UTF-8') as f:
raw_short_category_names = [l.strip().split(' | ') for l in f.readlines()]
short_category_names = {k.lower(): v for v, k in raw_short_category_names}
assert(len(raw_short_category_names) == len(short_category... | 39.366667 | 252 | 0.603443 | import csv
import sys
import os
with open('short_category_names.txt', encoding='UTF-8') as f:
raw_short_category_names = [l.strip().split(' | ') for l in f.readlines()]
short_category_names = {k.lower(): v for v, k in raw_short_category_names}
assert(len(raw_short_category_names) == len(short_category... | true | true |
f7f40f7c1750d594014faef77e7ae0348093a043 | 1,947 | py | Python | autosklearn/pipeline/components/feature_preprocessing/truncatedSVD.py | jimgoo/auto-sklearn | a263efb49f7b7f597963bc1e787105ea7615ea75 | [
"BSD-3-Clause"
] | 1 | 2017-08-13T13:57:40.000Z | 2017-08-13T13:57:40.000Z | autosklearn/pipeline/components/feature_preprocessing/truncatedSVD.py | jimgoo/auto-sklearn | a263efb49f7b7f597963bc1e787105ea7615ea75 | [
"BSD-3-Clause"
] | null | null | null | autosklearn/pipeline/components/feature_preprocessing/truncatedSVD.py | jimgoo/auto-sklearn | a263efb49f7b7f597963bc1e787105ea7615ea75 | [
"BSD-3-Clause"
] | 1 | 2020-05-06T14:47:17.000Z | 2020-05-06T14:47:17.000Z | import numpy as np
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformIntegerHyperparameter
from autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm
from autosklearn.pipeline.constants import *
class TruncatedSVD(AutoSklearnPreproc... | 36.055556 | 102 | 0.669235 | import numpy as np
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformIntegerHyperparameter
from autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm
from autosklearn.pipeline.constants import *
class TruncatedSVD(AutoSklearnPreproc... | true | true |
f7f40fb920aadd6347e4f4999fd6e57e6f472b3c | 5,362 | py | Python | Homework_1/exercise3.py | billsioros/computational-geometry | 398a92e3c08046f85eb3e95828afe62230b816fb | [
"MIT"
] | null | null | null | Homework_1/exercise3.py | billsioros/computational-geometry | 398a92e3c08046f85eb3e95828afe62230b816fb | [
"MIT"
] | null | null | null | Homework_1/exercise3.py | billsioros/computational-geometry | 398a92e3c08046f85eb3e95828afe62230b816fb | [
"MIT"
] | null | null | null | from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
import numpy as np
import random
from exercise1 import check_for_triangle
from exercise1 import plot_2D_points
def remove_duplicates(lst):
return [item for item in (set(tuple(i) for i in lst))]
# select a point from avaliable points (for... | 34.593548 | 106 | 0.593249 | from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
import numpy as np
import random
from exercise1 import check_for_triangle
from exercise1 import plot_2D_points
def remove_duplicates(lst):
return [item for item in (set(tuple(i) for i in lst))]
def select_random_point(current_hull_point... | true | true |
f7f4100a55b24087525dc65b150edeb9c86028d8 | 2,718 | py | Python | 8.backend/8.4.workshop8-integration-member-backend/app/member.py | tarathep/automation-test-course | 68ace45c2660b1d811eee0f1d38f2955a10b387c | [
"Apache-2.0"
] | null | null | null | 8.backend/8.4.workshop8-integration-member-backend/app/member.py | tarathep/automation-test-course | 68ace45c2660b1d811eee0f1d38f2955a10b387c | [
"Apache-2.0"
] | null | null | null | 8.backend/8.4.workshop8-integration-member-backend/app/member.py | tarathep/automation-test-course | 68ace45c2660b1d811eee0f1d38f2955a10b387c | [
"Apache-2.0"
] | 1 | 2020-12-13T03:16:22.000Z | 2020-12-13T03:16:22.000Z | from bottle import Bottle, Route, run,response,request
import json
import db
app = Bottle()
#INIT LOAD DATA
members = db.members
@app.route('/')
def hello():
print("----> GET Hello Member System")
return 'Hello Member System'
@app.route('/members', method='GET')
def getMember():
print("----> GET ME... | 30.2 | 93 | 0.608168 | from bottle import Bottle, Route, run,response,request
import json
import db
app = Bottle()
members = db.members
@app.route('/')
def hello():
print("----> GET Hello Member System")
return 'Hello Member System'
@app.route('/members', method='GET')
def getMember():
print("----> GET MEMBER(S)")
... | true | true |
f7f410b41557f63d0f18dd71e8ff811f9be33826 | 1,191 | py | Python | netdev/vendors/__init__.py | awesome-python/netdev | b96334c2ff92715c87e1ab388fcc7d48506aa954 | [
"Apache-2.0"
] | null | null | null | netdev/vendors/__init__.py | awesome-python/netdev | b96334c2ff92715c87e1ab388fcc7d48506aa954 | [
"Apache-2.0"
] | null | null | null | netdev/vendors/__init__.py | awesome-python/netdev | b96334c2ff92715c87e1ab388fcc7d48506aa954 | [
"Apache-2.0"
] | 1 | 2021-01-16T13:43:20.000Z | 2021-01-16T13:43:20.000Z | from netdev.vendors.arista import AristaEOS
from netdev.vendors.aruba import ArubaAOS8, ArubaAOS6
from netdev.vendors.base import BaseDevice
from netdev.vendors.cisco import CiscoNXOS, CiscoIOSXR, CiscoASA, CiscoIOS
from netdev.vendors.comware_like import ComwareLikeDevice
from netdev.vendors.fujitsu import Fujits... | 28.357143 | 75 | 0.717045 | from netdev.vendors.arista import AristaEOS
from netdev.vendors.aruba import ArubaAOS8, ArubaAOS6
from netdev.vendors.base import BaseDevice
from netdev.vendors.cisco import CiscoNXOS, CiscoIOSXR, CiscoASA, CiscoIOS
from netdev.vendors.comware_like import ComwareLikeDevice
from netdev.vendors.fujitsu import Fujits... | true | true |
f7f4110062ee768678744026d1128b2f9a41e26a | 88 | py | Python | axis-label/__init__.py | johnvorsten/mpl-rotate-axis-label | 89cd2cfe9d774b0b34fa5f16890fca75bcc62e99 | [
"MIT"
] | null | null | null | axis-label/__init__.py | johnvorsten/mpl-rotate-axis-label | 89cd2cfe9d774b0b34fa5f16890fca75bcc62e99 | [
"MIT"
] | null | null | null | axis-label/__init__.py | johnvorsten/mpl-rotate-axis-label | 89cd2cfe9d774b0b34fa5f16890fca75bcc62e99 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 3 20:16:22 2020
@author: z003vrzk
"""
| 11 | 35 | 0.568182 | true | true | |
f7f41271e1e43e146b567ad4a2ee1b52ebbb1dcb | 1,887 | py | Python | test/test_cost_model_out_all_of.py | chargio/using-koku-api-test | 2f41fd83ab730705352b116b7a6e05ae3d9a8ebd | [
"MIT"
] | 1 | 2020-03-18T11:32:09.000Z | 2020-03-18T11:32:09.000Z | test/test_cost_model_out_all_of.py | chargio/using-koku-api-test | 2f41fd83ab730705352b116b7a6e05ae3d9a8ebd | [
"MIT"
] | null | null | null | test/test_cost_model_out_all_of.py | chargio/using-koku-api-test | 2f41fd83ab730705352b116b7a6e05ae3d9a8ebd | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Cost Management
The API for Project Koku and OpenShift cost management. You can find out more about Cost Management at [https://github.com/project-koku/](https://github.com/project-koku/). # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-gener... | 32.534483 | 190 | 0.649709 |
from __future__ import absolute_import
import unittest
import datetime
import openapi_client
from openapi_client.models.cost_model_out_all_of import CostModelOutAllOf
from openapi_client.rest import ApiException
class TestCostModelOutAllOf(unittest.TestCase):
def setUp(self):
pass
def tearDow... | true | true |
f7f4127843ae4e85ff5c4861c1d8b06a4355526f | 3,006 | py | Python | data_structure_python/chapter4.py | nowindxdw/PlayWithDataStructure | a058adcc6dc5b7a4f1b4b49fd1fa2d86d619d95a | [
"MIT"
] | null | null | null | data_structure_python/chapter4.py | nowindxdw/PlayWithDataStructure | a058adcc6dc5b7a4f1b4b49fd1fa2d86d619d95a | [
"MIT"
] | null | null | null | data_structure_python/chapter4.py | nowindxdw/PlayWithDataStructure | a058adcc6dc5b7a4f1b4b49fd1fa2d86d619d95a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#普通迭代实现
def fib(n):
if n == 0:
return [0]
if n == 1:
return [0,1]
temp = [0,1]
for i in range(2,n):
temp.append(temp[i-2]+temp[i-1])
return temp
# 递归实现
def fib_recursion(n):
if n<2 :
return n
return fib_recursion(n-1)+fib_recursion... | 24.439024 | 65 | 0.494677 |
def fib(n):
if n == 0:
return [0]
if n == 1:
return [0,1]
temp = [0,1]
for i in range(2,n):
temp.append(temp[i-2]+temp[i-1])
return temp
def fib_recursion(n):
if n<2 :
return n
return fib_recursion(n-1)+fib_recursion(n-2)
def cal(num1,num2,str):
... | true | true |
f7f4130aab656d4152bb986827c22249c5e9137f | 628 | py | Python | molecule/check-iptables-nat/tests/test_default.py | Akanoa/ansible-role-docker | fd3516f2e001b9ff1eeb31e251ab835ae9b41250 | [
"MIT"
] | null | null | null | molecule/check-iptables-nat/tests/test_default.py | Akanoa/ansible-role-docker | fd3516f2e001b9ff1eeb31e251ab835ae9b41250 | [
"MIT"
] | null | null | null | molecule/check-iptables-nat/tests/test_default.py | Akanoa/ansible-role-docker | fd3516f2e001b9ff1eeb31e251ab835ae9b41250 | [
"MIT"
] | null | null | null | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("instance")
def test_iptables_filter(host):
cmd = host.run_expect(
expected=[0],
command="iptables --table filter --list-rules",
... | 24.153846 | 63 | 0.68949 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("instance")
def test_iptables_filter(host):
cmd = host.run_expect(
expected=[0],
command="iptables --table filter --list-rules",
... | true | true |
f7f41344688cdabc239bd48df4d8c1eee5c8d53a | 1,640 | py | Python | core/urls.py | IkramKhan-DevOps/cws-post | 2a242de51f640968d96fd947bed4aa4484afc52d | [
"MIT"
] | 2 | 2022-02-04T07:45:57.000Z | 2022-02-04T07:46:03.000Z | core/urls.py | IkramKhan-DevOps/cws-post | 2a242de51f640968d96fd947bed4aa4484afc52d | [
"MIT"
] | null | null | null | core/urls.py | IkramKhan-DevOps/cws-post | 2a242de51f640968d96fd947bed4aa4484afc52d | [
"MIT"
] | null | null | null | # import notifications.urls
# from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from src.accounts.views import GoogleLoginView, CustomRegisterAccountView
from .settings import DEBUG, MEDIA_ROOT, MEDIA_URL
from django.contr... | 42.051282 | 113 | 0.579268 |
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from src.accounts.views import GoogleLoginView, CustomRegisterAccountView
from .settings import DEBUG, MEDIA_ROOT, MEDIA_URL
from django.contrib.auth import views as auth_views
urlpatterns = [
... | true | true |
f7f41385bbed53cc247be2fac44dc5c617372505 | 1,314 | py | Python | westworld/_deprecated/chicken_game.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | null | null | null | westworld/_deprecated/chicken_game.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | 3 | 2021-09-06T23:12:23.000Z | 2021-09-17T01:04:34.000Z | westworld/_deprecated/chicken_game.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | null | null | null |
import sys
sys.path.append("C:/git/reinforcement-learning")
from hyperion.agents import *
from hyperion.environment import *
import random
import numpy as np
import uuid
import attr
STATUSES = ["EGG","CHICKEN","COW","FARMER","SUPERMAN"]
SIZE = 100
@attr.s(slots = True)
class Player(Agent):
# # Agent id
... | 18.25 | 54 | 0.560122 |
import sys
sys.path.append("C:/git/reinforcement-learning")
from hyperion.agents import *
from hyperion.environment import *
import random
import numpy as np
import uuid
import attr
STATUSES = ["EGG","CHICKEN","COW","FARMER","SUPERMAN"]
SIZE = 100
@attr.s(slots = True)
class Player(Agent):
... | true | true |
f7f413bf1610375f739f9ec188612136975e9eda | 2,021 | py | Python | otp/chat/TalkAssistant.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | otp/chat/TalkAssistant.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | otp/chat/TalkAssistant.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | from direct.directnotify import DirectNotifyGlobal
from direct.showbase import DirectObject
from otp.chat.ChatGlobals import *
from otp.nametag.NametagConstants import *
import ChatUtil
class TalkAssistant(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('TalkAssistant')
def de... | 38.132075 | 88 | 0.675903 | from direct.directnotify import DirectNotifyGlobal
from direct.showbase import DirectObject
from otp.chat.ChatGlobals import *
from otp.nametag.NametagConstants import *
import ChatUtil
class TalkAssistant(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('TalkAssistant')
def de... | true | true |
f7f41706f12c57d7602cd0696478c6daacd52dab | 5,785 | py | Python | framework/auth/__init__.py | lbanner/osf.io | 1898ef0ff8bd91713e94c60e7463b5f81ac62caa | [
"Apache-2.0"
] | null | null | null | framework/auth/__init__.py | lbanner/osf.io | 1898ef0ff8bd91713e94c60e7463b5f81ac62caa | [
"Apache-2.0"
] | null | null | null | framework/auth/__init__.py | lbanner/osf.io | 1898ef0ff8bd91713e94c60e7463b5f81ac62caa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from framework.sessions import session, create_session, goback
from framework import bcrypt
from framework.auth.exceptions import (
DuplicateEmailError,
LoginDisabledError,
LoginNotAllowedError,
PasswordIncorrectError,
TwoFactorValidationError,
)
from framework.flask import ... | 30.608466 | 80 | 0.680899 |
from framework.sessions import session, create_session, goback
from framework import bcrypt
from framework.auth.exceptions import (
DuplicateEmailError,
LoginDisabledError,
LoginNotAllowedError,
PasswordIncorrectError,
TwoFactorValidationError,
)
from framework.flask import redirect
from website ... | true | true |
f7f4170a498857b9a9fa0c6fbffb7a3358b49cf8 | 2,081 | py | Python | keras/layers/activation/thresholded_relu_test.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/layers/activation/thresholded_relu_test.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/layers/activation/thresholded_relu_test.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.564516 | 80 | 0.612686 |
import tensorflow.compat.v2 as tf
import keras
from keras.testing_infra import test_combinations
from keras.testing_infra import test_utils
@test_combinations.run_all_keras_modes
class ThresholdedReLUTest(test_combinations.TestCase):
def test_thresholded_relu(self):
test_utils.layer_test(
... | true | true |
f7f41721b933a2136b318aeae4ada52fe97578af | 1,170 | py | Python | tests/web/test_expires.py | spaceone/circuits | ed6d5464f1f83034109ed3d23d126c715450cfd2 | [
"MIT"
] | null | null | null | tests/web/test_expires.py | spaceone/circuits | ed6d5464f1f83034109ed3d23d126c715450cfd2 | [
"MIT"
] | null | null | null | tests/web/test_expires.py | spaceone/circuits | ed6d5464f1f83034109ed3d23d126c715450cfd2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from datetime import datetime
from email.utils import parsedate
from time import mktime
from circuits.web import Controller
from .helpers import urlopen
class Root(Controller):
def index(self):
self.expires(60)
return "Hello World!"
def nocache(self):
self.exp... | 24.375 | 79 | 0.641026 |
from datetime import datetime
from email.utils import parsedate
from time import mktime
from circuits.web import Controller
from .helpers import urlopen
class Root(Controller):
def index(self):
self.expires(60)
return "Hello World!"
def nocache(self):
self.expires(0)
retur... | true | true |
f7f4180652cbbd58c0792e505432be95af9d892d | 1,219 | py | Python | data.py | garethcmurphy/ml-quality | 87c1d87d0d1a2cfddff082f56731711804abbe5f | [
"BSD-2-Clause"
] | null | null | null | data.py | garethcmurphy/ml-quality | 87c1d87d0d1a2cfddff082f56731711804abbe5f | [
"BSD-2-Clause"
] | null | null | null | data.py | garethcmurphy/ml-quality | 87c1d87d0d1a2cfddff082f56731711804abbe5f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
"""generate data"""
import random
class Data():
"""generate data"""
file_name = "./data.csv"
def __init__(self):
pass
def generate(self):
"""generate data"""
with open(self.file_name, "w") as file:
print("pid,hindex,hindex2,hindex3,hindex4,d... | 29.02381 | 83 | 0.477441 |
import random
class Data():
file_name = "./data.csv"
def __init__(self):
pass
def generate(self):
with open(self.file_name, "w") as file:
print("pid,hindex,hindex2,hindex3,hindex4,data_type,target", file=file)
for _ in range(1, 10001):
pid = rando... | true | true |
f7f418828c250c2b31f208cd61683f6e653e9bf9 | 1,780 | py | Python | h2o-py/tests/testdir_misc/pyunit_xgboost_gbm_monotone.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_misc/pyunit_xgboost_gbm_monotone.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_misc/pyunit_xgboost_gbm_monotone.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | from h2o.estimators.xgboost import *
from h2o.estimators.gbm import *
from tests import pyunit_utils
def xgboost_vs_gbm_monotone_test():
assert H2OXGBoostEstimator.available() is True
monotone_constraints = {
"AGE": 1
}
xgboost_params = {
"tree_method": "exact",
"seed": 123,
... | 34.901961 | 101 | 0.710674 | from h2o.estimators.xgboost import *
from h2o.estimators.gbm import *
from tests import pyunit_utils
def xgboost_vs_gbm_monotone_test():
assert H2OXGBoostEstimator.available() is True
monotone_constraints = {
"AGE": 1
}
xgboost_params = {
"tree_method": "exact",
"seed": 123,
... | true | true |
f7f41882ddeadf12aa90c8d7c69b38bf11de007f | 1,551 | py | Python | crits/samples/urls.py | thelandy/crits | e8d72d8e3cb278d6e86215ba2bb567a874c66edd | [
"MIT"
] | null | null | null | crits/samples/urls.py | thelandy/crits | e8d72d8e3cb278d6e86215ba2bb567a874c66edd | [
"MIT"
] | null | null | null | crits/samples/urls.py | thelandy/crits | e8d72d8e3cb278d6e86215ba2bb567a874c66edd | [
"MIT"
] | null | null | null | from django.conf.urls import patterns
urlpatterns = patterns('crits.samples.views',
(r'^upload/$', 'upload_file'),
(r'^upload/(?P<related_md5>\w+)/$', 'upload_file'),
(r'^upload_list/(?P<filename>[\S ]+)/(?P<md5s>.+)/$', 'view_upload_list'),
(r'^bulkadd/$', 'bulk_add_md5_sample'),
... | 48.46875 | 82 | 0.526112 | from django.conf.urls import patterns
urlpatterns = patterns('crits.samples.views',
(r'^upload/$', 'upload_file'),
(r'^upload/(?P<related_md5>\w+)/$', 'upload_file'),
(r'^upload_list/(?P<filename>[\S ]+)/(?P<md5s>.+)/$', 'view_upload_list'),
(r'^bulkadd/$', 'bulk_add_md5_sample'),
... | true | true |
f7f419ef876a7d1603cacc657b7b657cae843ddf | 7,131 | py | Python | Wav2Lip/util/wav2lip_inference_funcs.py | tpulkit/txt2vid | 679b1672fb3221c6b5fe576a158974556047c201 | [
"FTL"
] | 40 | 2021-06-26T13:17:08.000Z | 2022-02-15T13:00:08.000Z | Wav2Lip/util/wav2lip_inference_funcs.py | tpulkit/txt2vid | 679b1672fb3221c6b5fe576a158974556047c201 | [
"FTL"
] | 3 | 2021-09-23T09:35:12.000Z | 2022-01-23T18:02:15.000Z | Wav2Lip/util/wav2lip_inference_funcs.py | tpulkit/txt2vid | 679b1672fb3221c6b5fe576a158974556047c201 | [
"FTL"
] | 3 | 2021-06-29T03:53:39.000Z | 2022-02-15T02:25:48.000Z | import numpy as np
import os
import cv2
from models import Wav2Lip
import face_detection
import torch
def get_smoothened_boxes(boxes, T):
for i in range(len(boxes)):
if i + T > len(boxes):
window = boxes[len(boxes) - T:]
else:
window = boxes[i: i + T]
boxes[i] = np.m... | 36.569231 | 121 | 0.60833 | import numpy as np
import os
import cv2
from models import Wav2Lip
import face_detection
import torch
def get_smoothened_boxes(boxes, T):
for i in range(len(boxes)):
if i + T > len(boxes):
window = boxes[len(boxes) - T:]
else:
window = boxes[i: i + T]
boxes[i] = np.m... | true | true |
f7f41b244668f3643653733211a063e2467f29e9 | 713 | py | Python | docs/papers/sc2013/hyantes_core.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,647 | 2015-01-13T01:45:38.000Z | 2022-03-28T01:23:41.000Z | docs/papers/sc2013/hyantes_core.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,116 | 2015-01-01T09:52:05.000Z | 2022-03-18T21:06:40.000Z | docs/papers/sc2013/hyantes_core.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 180 | 2015-02-12T02:47:28.000Z | 2022-03-14T10:28:18.000Z | #pythran export run(float, float, float, float, float, float, int, int, float [][])
import math
from numpy import zeros
def run(xmin, ymin, xmax, ymax, step, range_, range_x, range_y, t):
pt = zeros((range_x, range_y, 3))
"omp parallel for private(i,j,k,tmp)"
for i in xrange(range_x):
for j in xrang... | 47.533333 | 155 | 0.565217 |
import math
from numpy import zeros
def run(xmin, ymin, xmax, ymax, step, range_, range_x, range_y, t):
pt = zeros((range_x, range_y, 3))
for i in xrange(range_x):
for j in xrange(range_y):
pt[i,j,0], pt[i,j,1] = (xmin+step*i)*180/math.pi, (ymin+step*j)*180/math.pi
for k in xran... | true | true |
f7f41b249634528b4b7b485ba1ffb5bbaabc4f6a | 16,298 | py | Python | statsmodels/sandbox/tsa/fftarma.py | rebecca-palmer/statsmodels | 27dd8ba0be0211fdc91097463ce4edd28bce1ef4 | [
"BSD-3-Clause"
] | 1 | 2019-08-23T20:30:11.000Z | 2019-08-23T20:30:11.000Z | statsmodels/sandbox/tsa/fftarma.py | rebecca-palmer/statsmodels | 27dd8ba0be0211fdc91097463ce4edd28bce1ef4 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/sandbox/tsa/fftarma.py | rebecca-palmer/statsmodels | 27dd8ba0be0211fdc91097463ce4edd28bce1ef4 | [
"BSD-3-Clause"
] | 1 | 2018-10-12T07:51:38.000Z | 2018-10-12T07:51:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 19:53:25 2009
Author: josef-pktd
generate arma sample using fft with all the lfilter it looks slow
to get the ma representation first
apply arma filter (in ar representation) to time series to get white noise
but seems slow to be useful for fast estimation for nobs=1... | 30.237477 | 84 | 0.580869 |
import numpy as np
import numpy.fft as fft
from scipy import signal
from statsmodels.tsa.arima_process import ArmaProcess
class ArmaFft(ArmaProcess):
def __init__(self, ar, ma, n):
super(ArmaFft, self).__init__(ar, ma)
self.ar = np.asarray(ar)
self.ma = np.asarray(ma)
... | true | true |
f7f41c5f4bf2450220853ee97cd2400f292f0cf8 | 8,608 | py | Python | beanie/api/work_centre_group_api.py | altoyield/python-beanieclient | 448b8dd328054eaf32dd7d0bdff700e603b5c27d | [
"Apache-2.0"
] | null | null | null | beanie/api/work_centre_group_api.py | altoyield/python-beanieclient | 448b8dd328054eaf32dd7d0bdff700e603b5c27d | [
"Apache-2.0"
] | null | null | null | beanie/api/work_centre_group_api.py | altoyield/python-beanieclient | 448b8dd328054eaf32dd7d0bdff700e603b5c27d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Beanie ERP API
An API specification for interacting with the Beanie ERP system # noqa: E501
OpenAPI spec version: 0.8
Contact: dev@bean.ie
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
#... | 36.786325 | 125 | 0.611408 |
"""
Beanie ERP API
An API specification for interacting with the Beanie ERP system # noqa: E501
OpenAPI spec version: 0.8
Contact: dev@bean.ie
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re
import six
from beanie.api... | false | true |
f7f41c793899f68e8ba0033b7ab4a050f6d2c806 | 1,142 | py | Python | Hyperband/Embeddings/GLOVE.py | tian1327/AutoLDA | be202b70b6d0a02b75ff05016dcd7084c32a9ccf | [
"MIT"
] | 1 | 2022-01-31T01:09:31.000Z | 2022-01-31T01:09:31.000Z | Hyperband/Embeddings/GLOVE.py | tian1327/AutoLDA | be202b70b6d0a02b75ff05016dcd7084c32a9ccf | [
"MIT"
] | null | null | null | Hyperband/Embeddings/GLOVE.py | tian1327/AutoLDA | be202b70b6d0a02b75ff05016dcd7084c32a9ccf | [
"MIT"
] | null | null | null | import os
import numpy as np
import pickle
# import tqdm
def load_GLOVE():
model = 'glove_pretrained_840b_300d.pkl'
print("loading GLOVE pretrained model ......")
with open('./Embeddings/GLOVE_pretrained/'+model,'rb') as pk:
glove_emb = pickle.load(pk)
print('GLOVE loaded.\n')
return glove... | 27.853659 | 77 | 0.641856 | import os
import numpy as np
import pickle
def load_GLOVE():
model = 'glove_pretrained_840b_300d.pkl'
print("loading GLOVE pretrained model ......")
with open('./Embeddings/GLOVE_pretrained/'+model,'rb') as pk:
glove_emb = pickle.load(pk)
print('GLOVE loaded.\n')
return glove_emb
def gen... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.