hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c11f532742dc429bda0423e8052aa8ce0b46bf0 | 4,653 | py | Python | pylib/uxml/uxpath/__init__.py | uogbuji/amara3-xml | 10936358be4403f50ef77305bec1bf77f873a3c6 | [
"Apache-2.0"
] | 7 | 2015-02-03T05:03:42.000Z | 2021-04-17T15:39:39.000Z | pylib/uxml/uxpath/__init__.py | uogbuji/amara3-xml | 10936358be4403f50ef77305bec1bf77f873a3c6 | [
"Apache-2.0"
] | 4 | 2015-05-08T15:36:55.000Z | 2021-02-03T17:24:50.000Z | pylib/uxml/uxpath/__init__.py | uogbuji/amara3-xml | 10936358be4403f50ef77305bec1bf77f873a3c6 | [
"Apache-2.0"
] | 2 | 2018-11-11T03:08:54.000Z | 2019-07-24T06:02:35.000Z | # amara3.uxml.uxpath
'''
from amara3.uxml.uxpath import qquery
results = qquery(b'<a>1<b>2</b>3</a>', 'a/text()'))
next(results).xml_value
next(results).xml_value
from amara3.uxml import tree
DOC = '<a><b><x>1</x></b><c><x>2</x><d><x>3</x></d></c><x>4</x><y>5</y></a>'
tb = tree.treebuilder()
root = tb.parse(DOC)
fro... | 33.963504 | 154 | 0.680206 |
import os
import re
import tempfile
from ply import lex, yacc
from amara3.uxml import tree
from amara3.uxml.treeutil import *
from amara3.uxml.tree import node as nodetype
from amara3.util import coroutine
from . import lexrules, parserules, ast
from .functions import BUILTIN_FUNCTIONS
__all__ = ['lexer', 'parser'... | true | true |
1c11f572578d67439827b89119cc7360318d3137 | 2,970 | py | Python | template_builder/test/test_simtelarray_config.py | thomasarmstrong/template_builder | 8dafb5da21e0b3cf9ef9bf8a5a76c9077657e686 | [
"BSD-3-Clause"
] | 5 | 2019-08-21T08:24:52.000Z | 2021-12-15T10:08:01.000Z | template_builder/test/test_simtelarray_config.py | thomasarmstrong/template_builder | 8dafb5da21e0b3cf9ef9bf8a5a76c9077657e686 | [
"BSD-3-Clause"
] | null | null | null | template_builder/test/test_simtelarray_config.py | thomasarmstrong/template_builder | 8dafb5da21e0b3cf9ef9bf8a5a76c9077657e686 | [
"BSD-3-Clause"
] | 2 | 2019-08-26T08:24:39.000Z | 2021-02-05T11:31:28.000Z | from template_builder.simtelarray_config import SimTelArrayConfig
from pathlib import Path
import os
def test_config_creation():
config = SimTelArrayConfig(config_name="test_config", config_file="test.cfg",
altitude="0", atmospheric_profile="dummy.dat",
... | 47.903226 | 90 | 0.652862 | from template_builder.simtelarray_config import SimTelArrayConfig
from pathlib import Path
import os
def test_config_creation():
config = SimTelArrayConfig(config_name="test_config", config_file="test.cfg",
altitude="0", atmospheric_profile="dummy.dat",
... | true | true |
1c11f6967686c64849500cb19b829d49f8da8257 | 2,482 | py | Python | tools/tianchi_xray/vis/run.py | vivym/maskrcnn-benchmark | 4e1763ae09dab1ceebafad54412df657790ec9dc | [
"MIT"
] | null | null | null | tools/tianchi_xray/vis/run.py | vivym/maskrcnn-benchmark | 4e1763ae09dab1ceebafad54412df657790ec9dc | [
"MIT"
] | null | null | null | tools/tianchi_xray/vis/run.py | vivym/maskrcnn-benchmark | 4e1763ae09dab1ceebafad54412df657790ec9dc | [
"MIT"
] | null | null | null | import argparse
import os, sys
import cv2
import torch
from torchvision import transforms as T
this_dir = os.path.dirname(os.path.abspath(__file__))
root_dir = os.path.abspath(os.path.join(this_dir, '..', '..'))
if root_dir not in sys.path:
sys.path.insert(0, root_dir)
from maskrcnn_benchmark.config import cfg
f... | 25.326531 | 83 | 0.671636 | import argparse
import os, sys
import cv2
import torch
from torchvision import transforms as T
this_dir = os.path.dirname(os.path.abspath(__file__))
root_dir = os.path.abspath(os.path.join(this_dir, '..', '..'))
if root_dir not in sys.path:
sys.path.insert(0, root_dir)
from maskrcnn_benchmark.config import cfg
f... | true | true |
1c11f73e396950dd4700345848f9c4cfeeed8957 | 1,080 | py | Python | code_practice/functions.py | FRC1076/2019-wapur | e872489792e9573b7205eccde55be21705af6e3c | [
"MIT"
] | 2 | 2018-11-15T23:22:31.000Z | 2019-11-28T23:58:34.000Z | code_practice/functions.py | FRC1076/2019-wapur | e872489792e9573b7205eccde55be21705af6e3c | [
"MIT"
] | 1 | 2018-11-06T03:50:27.000Z | 2018-11-06T03:54:35.000Z | code_practice/functions.py | FRC1076/2019-wapur | e872489792e9573b7205eccde55be21705af6e3c | [
"MIT"
] | null | null | null | import functions_variables
import random
# Given a direction the robot is facing, find the direction
# that the robot would then be facing if the robot turned right.
init_direction = random.randint(0, 3)
fin_direction_right = None
fin_direction_left = None
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
#--------------------... | 24 | 94 | 0.55 | import functions_variables
import random
init_direction = random.randint(0, 3)
fin_direction_right = None
fin_direction_left = None
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
def direction_to_right(direction):
...
def direction_to_left(direction):
...
to_right = [EAST, SOUTH, WEST, NORTH]
to_left = [WE... | true | true |
1c11f74f75c581b6aee4b3ac0f936ad04e71214a | 4,472 | py | Python | hdltools/vhdl/codegen.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 2 | 2020-02-28T13:02:39.000Z | 2021-06-30T09:15:35.000Z | hdltools/vhdl/codegen.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 1 | 2020-03-22T17:32:45.000Z | 2020-03-23T15:43:39.000Z | hdltools/vhdl/codegen.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | null | null | null | """Generate VHDL code."""
import math
from ..abshdl.codegen import HDLCodeGenerator, indent
class VHDLCodeGenerator(HDLCodeGenerator):
"""Generate VHDL code."""
VHDL_PORT_DIRECTION = ['in', 'out', 'inout']
VHDL_SIGNAL_TYPE = ['signal']
def gen_HDLModulePort(self, element, **kwargs):
"""Gene... | 32.882353 | 79 | 0.497317 |
import math
from ..abshdl.codegen import HDLCodeGenerator, indent
class VHDLCodeGenerator(HDLCodeGenerator):
VHDL_PORT_DIRECTION = ['in', 'out', 'inout']
VHDL_SIGNAL_TYPE = ['signal']
def gen_HDLModulePort(self, element, **kwargs):
if 'evaluate' in kwargs:
evaluate = kwargs['evaluat... | true | true |
1c11f768b4d1bbba9cbff96e5780840ccb13ce5e | 5,225 | py | Python | mirage/modules/esb_prx.py | epablosensei/mirage | 3c0d2fb0f0e570356e7126c999e83e0256920420 | [
"MIT"
] | 123 | 2019-11-20T19:53:23.000Z | 2022-03-07T19:51:03.000Z | mirage/modules/esb_prx.py | epablosensei/mirage | 3c0d2fb0f0e570356e7126c999e83e0256920420 | [
"MIT"
] | 23 | 2019-10-22T13:53:34.000Z | 2022-03-22T22:22:55.000Z | mirage/modules/esb_prx.py | epablosensei/mirage | 3c0d2fb0f0e570356e7126c999e83e0256920420 | [
"MIT"
] | 25 | 2019-11-15T12:13:48.000Z | 2021-12-22T00:21:15.000Z | import subprocess,sys
from mirage.libs import io,utils,esb,wireless
from mirage.core import module,interpreter
from threading import Lock
class esb_prx(module.WirelessModule, interpreter.Interpreter):
def init(self):
self.technology = "esb"
self.type = "spoofing"
self.description = "This module permits the Use... | 28.708791 | 187 | 0.686124 | import subprocess,sys
from mirage.libs import io,utils,esb,wireless
from mirage.core import module,interpreter
from threading import Lock
class esb_prx(module.WirelessModule, interpreter.Interpreter):
def init(self):
self.technology = "esb"
self.type = "spoofing"
self.description = "This module permits the Use... | true | true |
1c11f8014b16d9428726c69e9882644f876db5eb | 1,200 | py | Python | amelia/profiles/profile.py | nayamonia/amelia | 09bfa58bcdaa0bc0adc6ba07355b10db8927b581 | [
"MIT"
] | null | null | null | amelia/profiles/profile.py | nayamonia/amelia | 09bfa58bcdaa0bc0adc6ba07355b10db8927b581 | [
"MIT"
] | null | null | null | amelia/profiles/profile.py | nayamonia/amelia | 09bfa58bcdaa0bc0adc6ba07355b10db8927b581 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
The MIT License (MIT)
Copyright (c) 2012 Gabriel Fernandes
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 ... | 44.444444 | 80 | 0.79 | from profiles import zanthus, geral
PROFILES = [geral.PROFILE, zanthus.PROFILE]
| true | true |
1c11f910f7112b62dd73991428a1e1192b3f795a | 609 | py | Python | src/atomate2/common/schemas/math.py | Zhuoying/atomate2 | 4501c8ff2a72243dee51afb17d93ecff426b3e8c | [
"BSD-3-Clause-LBNL"
] | 14 | 2021-09-24T05:18:02.000Z | 2022-03-31T23:12:47.000Z | src/atomate2/common/schemas/math.py | Zhuoying/atomate2 | 4501c8ff2a72243dee51afb17d93ecff426b3e8c | [
"BSD-3-Clause-LBNL"
] | 83 | 2021-11-02T17:19:57.000Z | 2022-03-31T17:27:00.000Z | src/atomate2/common/schemas/math.py | Zhuoying/atomate2 | 4501c8ff2a72243dee51afb17d93ecff426b3e8c | [
"BSD-3-Clause-LBNL"
] | 11 | 2021-11-19T09:50:45.000Z | 2022-03-31T05:56:39.000Z | """Schemas for matrices and vectors."""
from typing import Tuple
__all__ = ["Vector3D", "Vector6D", "Matrix3D", "MatrixVoigt"]
Vector3D = Tuple[float, float, float]
Vector3D.__doc__ = "Real space vector" # type: ignore
Matrix3D = Tuple[Vector3D, Vector3D, Vector3D]
Matrix3D.__doc__ = "Real space Matrix" # type: ... | 32.052632 | 79 | 0.738916 |
from typing import Tuple
__all__ = ["Vector3D", "Vector6D", "Matrix3D", "MatrixVoigt"]
Vector3D = Tuple[float, float, float]
Vector3D.__doc__ = "Real space vector"
Matrix3D = Tuple[Vector3D, Vector3D, Vector3D]
Matrix3D.__doc__ = "Real space Matrix"
Vector6D = Tuple[float, float, float, float, float, float]
Vec... | true | true |
1c11f94273b5111ca5dca10d21f12b55e4706460 | 2,173 | py | Python | data_source/pixiv/cache_manager.py | ssttkkl/nonebot-plugin-pixiv | f2276c923f45ceececd42474f43b5e60d1d9e504 | [
"MIT"
] | 5 | 2022-02-10T11:10:49.000Z | 2022-03-31T05:25:30.000Z | data_source/pixiv/cache_manager.py | ssttkkl/nonebot-plugin-pixiv | f2276c923f45ceececd42474f43b5e60d1d9e504 | [
"MIT"
] | 1 | 2022-01-16T10:50:00.000Z | 2022-01-16T11:41:28.000Z | data_source/pixiv/cache_manager.py | ssttkkl/nonebot-plugin-pixiv | f2276c923f45ceececd42474f43b5e60d1d9e504 | [
"MIT"
] | null | null | null | import asyncio
import typing
class CacheManager:
def __init__(self, simultaneous_query: int = 4):
self._semaphore = asyncio.Semaphore(
value=simultaneous_query) # 用于限制从远程获取的并发量
self._waiting = {}
T = typing.TypeVar("T")
async def get(self, identifier: typing.Any,
... | 38.122807 | 116 | 0.590428 | import asyncio
import typing
class CacheManager:
def __init__(self, simultaneous_query: int = 4):
self._semaphore = asyncio.Semaphore(
value=simultaneous_query) self._waiting = {}
T = typing.TypeVar("T")
async def get(self, identifier: typing.Any,
cache_loa... | true | true |
1c11f97b0d45077446501e41cb66338a509645e4 | 154 | py | Python | Scripts/django-admin.py | shekhar2702/My-First-Django-Project | dc90d05d7c525c3700051cd638a7b31680c0c7e7 | [
"bzip2-1.0.6"
] | null | null | null | Scripts/django-admin.py | shekhar2702/My-First-Django-Project | dc90d05d7c525c3700051cd638a7b31680c0c7e7 | [
"bzip2-1.0.6"
] | null | null | null | Scripts/django-admin.py | shekhar2702/My-First-Django-Project | dc90d05d7c525c3700051cd638a7b31680c0c7e7 | [
"bzip2-1.0.6"
] | null | null | null | #!c:\projects\django_project\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 25.666667 | 47 | 0.792208 | from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| true | true |
1c11fa31f6af0b8605aa97c0e4887d1677041561 | 106,217 | py | Python | agMontage/mViewer.py | AndrewDGood/mViewer | 3cde275c60204dca77d019263392864332f958b7 | [
"BSD-3-Clause"
] | null | null | null | agMontage/mViewer.py | AndrewDGood/mViewer | 3cde275c60204dca77d019263392864332f958b7 | [
"BSD-3-Clause"
] | null | null | null | agMontage/mViewer.py | AndrewDGood/mViewer | 3cde275c60204dca77d019263392864332f958b7 | [
"BSD-3-Clause"
] | null | null | null | #---------------------------------------------------------------------------------
# Montage Viewer Python Application
#---------------------------------------------------------------------------------
from threading import Thread
import tornado.ioloop
imp... | 32.935504 | 220 | 0.482766 |
from threading import Thread
import tornado.ioloop
import tornado.web
import tornado.websocket
import tornado.template
import sys
import socket
import webbrowser
import subprocess
import os
import errno
import sys
import tempfile
import shutil
import random
import hashlib
import shlex
import ma... | false | true |
1c11fa58d9dcd145add51103787bb6e8d6ff652a | 3,303 | py | Python | xero_python/payrolluk/models/employee_leave_balances.py | parasharrk/xero-python | e8416f3bd893520a343af014f5bb65acbf1f4f13 | [
"MIT"
] | null | null | null | xero_python/payrolluk/models/employee_leave_balances.py | parasharrk/xero-python | e8416f3bd893520a343af014f5bb65acbf1f4f13 | [
"MIT"
] | null | null | null | xero_python/payrolluk/models/employee_leave_balances.py | parasharrk/xero-python | e8416f3bd893520a343af014f5bb65acbf1f4f13 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Xero Payroll UK
This is the Xero Payroll API for orgs in the UK region. # noqa: E501
OpenAPI spec version: 2.4.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class EmployeeLeaveBal... | 26.637097 | 94 | 0.627611 |
import re
from xero_python.models import BaseModel
class EmployeeLeaveBalances(BaseModel):
openapi_types = {
"pagination": "Pagination",
"problem": "Problem",
"leave_balances": "list[EmployeeLeaveBalance]",
}
attribute_map = {
"pagination": "pagination",
"pro... | true | true |
1c11fb9aa32698c78a62abffbc0e57723977204e | 6,174 | py | Python | python/graphscope/deploy/hosts/cluster.py | GraphScope/GraphScope | 4f2a2e688c3b2b97316487ec49ef0301fd5c8d03 | [
"Apache-2.0"
] | 1 | 2022-03-21T07:48:13.000Z | 2022-03-21T07:48:13.000Z | python/graphscope/deploy/hosts/cluster.py | GraphScope/GraphScope | 4f2a2e688c3b2b97316487ec49ef0301fd5c8d03 | [
"Apache-2.0"
] | null | null | null | python/graphscope/deploy/hosts/cluster.py | GraphScope/GraphScope | 4f2a2e688c3b2b97316487ec49ef0301fd5c8d03 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... | 33.193548 | 93 | 0.610463 |
import logging
import os
import signal
import subprocess
import sys
import graphscope
from graphscope.config import GSConfig as gs_config
from graphscope.deploy.launcher import Launcher
from graphscope.framework.utils import PipeWatcher
from graphscope.framework.utils import get_free_port
from graphscope.framework.u... | true | true |
1c11fc1a0ced4f419db6584c2fef6381601ac5ec | 158,764 | py | Python | python/pyarrow/tests/test_pandas.py | mjunix/arrow | 4144c1739ec2e58d5f076fa63a0b61653324dc02 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_pandas.py | mjunix/arrow | 4144c1739ec2e58d5f076fa63a0b61653324dc02 | [
"Apache-2.0"
] | 2 | 2020-10-29T20:59:47.000Z | 2020-11-04T20:05:52.000Z | python/pyarrow/tests/test_pandas.py | mjunix/arrow | 4144c1739ec2e58d5f076fa63a0b61653324dc02 | [
"Apache-2.0"
] | 1 | 2020-08-27T22:54:09.000Z | 2020-08-27T22:54:09.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.000907 | 79 | 0.571691 |
import gc
import decimal
import json
import multiprocessing as mp
import sys
from collections import OrderedDict
from datetime import date, datetime, time, timedelta, timezone
import hypothesis as h
import hypothesis.extra.pytz as tzst
import hypothesis.strategies as st
import numpy as np
import numpy.testing as npt... | true | true |
1c11fcdb4f561f2bf19308ca6c9dec7c4608fba4 | 3,555 | py | Python | src/models/bert_token_spans.py | gchhablani/toxic-spans-detection | 5eeba0c069bef8c707d9c5fef8c6048c98d89ba5 | [
"MIT"
] | 11 | 2021-02-25T03:03:37.000Z | 2021-10-18T03:51:23.000Z | src/models/bert_token_spans.py | gchhablani/toxic-spans-detection | 5eeba0c069bef8c707d9c5fef8c6048c98d89ba5 | [
"MIT"
] | null | null | null | src/models/bert_token_spans.py | gchhablani/toxic-spans-detection | 5eeba0c069bef8c707d9c5fef8c6048c98d89ba5 | [
"MIT"
] | 5 | 2021-02-25T03:02:07.000Z | 2021-05-18T15:59:01.000Z | import torch.nn as nn
import torch
from torch.nn import CrossEntropyLoss
from transformers import BertPreTrainedModel, BertModel
from src.utils.mapper import configmapper
@configmapper.map("models", "bert_token_spans")
class BertModelForTokenAndSpans(BertPreTrainedModel):
def __init__(self, config, num_token_labe... | 37.03125 | 81 | 0.626723 | import torch.nn as nn
import torch
from torch.nn import CrossEntropyLoss
from transformers import BertPreTrainedModel, BertModel
from src.utils.mapper import configmapper
@configmapper.map("models", "bert_token_spans")
class BertModelForTokenAndSpans(BertPreTrainedModel):
def __init__(self, config, num_token_labe... | true | true |
1c11fcf9b80b094811d81d58e2bb3fe2d20e63b6 | 37,835 | py | Python | pyqtgraph/graphicsItems/ScatterPlotItem.py | Tillsten/pyqtgraph | 0045863165fe526988c58cf4f8232ae2d261a5ee | [
"MIT"
] | null | null | null | pyqtgraph/graphicsItems/ScatterPlotItem.py | Tillsten/pyqtgraph | 0045863165fe526988c58cf4f8232ae2d261a5ee | [
"MIT"
] | null | null | null | pyqtgraph/graphicsItems/ScatterPlotItem.py | Tillsten/pyqtgraph | 0045863165fe526988c58cf4f8232ae2d261a5ee | [
"MIT"
] | null | null | null | from ..Qt import QtGui, QtCore, USE_PYSIDE
from ..Point import Point
from .. import functions as fn
from .GraphicsItem import GraphicsItem
from .GraphicsObject import GraphicsObject
from itertools import starmap, repeat
try:
from itertools import imap
except ImportError:
imap = map
import numpy as np
import wea... | 39.166667 | 242 | 0.525334 | from ..Qt import QtGui, QtCore, USE_PYSIDE
from ..Point import Point
from .. import functions as fn
from .GraphicsItem import GraphicsItem
from .GraphicsObject import GraphicsObject
from itertools import starmap, repeat
try:
from itertools import imap
except ImportError:
imap = map
import numpy as np
import wea... | true | true |
1c11fd4b6ee7b9effc8e81f13c4c0bea8669224a | 71,158 | py | Python | tb_linefinder.py | amloren1/LineFinder | fccd16616239029cbba13c6eb5daad45fbfc480d | [
"MIT"
] | 2 | 2018-04-08T22:29:22.000Z | 2020-06-27T23:46:31.000Z | tb_linefinder.py | amloren1/LineFinder | fccd16616239029cbba13c6eb5daad45fbfc480d | [
"MIT"
] | null | null | null | tb_linefinder.py | amloren1/LineFinder | fccd16616239029cbba13c6eb5daad45fbfc480d | [
"MIT"
] | 5 | 2016-11-04T15:21:27.000Z | 2020-09-11T05:17:57.000Z | #!/usr/bin/python2.7
"""
TB_LINEFINDER.PY
v1.2.1 (5/02/2016)
Previous version was not loading limits properly from log. This is now fixed.
v1.2 (11/01/2016)
MAJOR revisions are:
-Changed element selection in LINEADDER from radiobuttons to checkbox
(fixes unselecting elements)
-Changed log-writing/editing to ... | 41.710434 | 144 | 0.715675 |
"""
TB_LINEFINDER.PY
v1.2.1 (5/02/2016)
Previous version was not loading limits properly from log. This is now fixed.
v1.2 (11/01/2016)
MAJOR revisions are:
-Changed element selection in LINEADDER from radiobuttons to checkbox
(fixes unselecting elements)
-Changed log-writing/editing to a GUI window rather t... | false | true |
1c11fd7dcf0556d5d70f969382f5294f5a1f1141 | 1,956 | py | Python | src/FileSorter.py | anconaesselmann/pySearch | c37bab3580cfc10d4ec648841162ee15d5b4444b | [
"MIT"
] | null | null | null | src/FileSorter.py | anconaesselmann/pySearch | c37bab3580cfc10d4ec648841162ee15d5b4444b | [
"MIT"
] | null | null | null | src/FileSorter.py | anconaesselmann/pySearch | c37bab3580cfc10d4ec648841162ee15d5b4444b | [
"MIT"
] | null | null | null | """
Sorts the content of a file by reading lines into memory to be sorted, creating intermediary files,
that then get merged together.
@author Axel Ancona Esselmann
"""
import os,io;
from FileMerger import FileMerger;
import shutil
class FileSorter():
def __init__(self, sortingAlgorythm, nbrInMemoryLines = 1000, ... | 39.12 | 99 | 0.589468 | import os,io;
from FileMerger import FileMerger;
import shutil
class FileSorter():
def __init__(self, sortingAlgorythm, nbrInMemoryLines = 1000, deleteIntermediary = True):
self._sortingAlgorythm = sortingAlgorythm;
self._nbrInMemoryLines = nbrInMemoryLines;
self._fileMerger = F... | true | true |
1c11fe68be6e917ef5e9282159a288f0f86fc1ea | 12,742 | py | Python | docs/conf.py | mctrinh/cadnano2.5 | d8254f24eef5fd77b4fb2b1a9642a8eea2e3c736 | [
"BSD-3-Clause"
] | 1 | 2022-03-27T14:37:32.000Z | 2022-03-27T14:37:32.000Z | docs/conf.py | mctrinh/cadnano2.5 | d8254f24eef5fd77b4fb2b1a9642a8eea2e3c736 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | mctrinh/cadnano2.5 | d8254f24eef5fd77b4fb2b1a9642a8eea2e3c736 | [
"BSD-3-Clause"
] | 1 | 2021-01-22T02:29:38.000Z | 2021-01-22T02:29:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# cadnano documentation build configuration file, originally created by
# sphinx-quickstart on Sat Jul 16 12:34:36 2016. Modified by NC
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration value... | 30.338095 | 125 | 0.690629 |
import os
import sys
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify
abspath = os.path.abspath
dirname = os.path.dirname
LOCAL_PATH = dirname(abspath(__file__))
CADNANO_PATH = dirname(LOCAL_PATH)
CADNANO_GUI_PATH = CADNANO_PATH + "/gui"
sys.path.insert(0, LOCAL_PATH)... | true | true |
1c11fecbc71e357340b6632e369c334810f2773f | 2,636 | py | Python | ironic/objects/port.py | citrix-openstack-build/ironic | 4b9eed0aeba44739caa742a48b55d824eae8ec55 | [
"Apache-2.0"
] | null | null | null | ironic/objects/port.py | citrix-openstack-build/ironic | 4b9eed0aeba44739caa742a48b55d824eae8ec55 | [
"Apache-2.0"
] | null | null | null | ironic/objects/port.py | citrix-openstack-build/ironic | 4b9eed0aeba44739caa742a48b55d824eae8ec55 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 31.380952 | 78 | 0.639985 |
from ironic.db import api as dbapi
from ironic.objects import base
from ironic.objects import utils
class Port(base.IronicObject):
dbapi = dbapi.get_instance()
fields = {
'id': int,
'uuid': utils.str_or_none,
'node_id': utils.int_or_none,
'address': utils.str_or_none,
... | true | true |
1c11ffe5c7e5d00d39710a215f7f0c1e3eb6f1dd | 3,628 | py | Python | setup.py | hartungstenio/drf-jsonmask | dde5922ffa09627d447a23cab16a4d1e094f5e14 | [
"0BSD"
] | null | null | null | setup.py | hartungstenio/drf-jsonmask | dde5922ffa09627d447a23cab16a4d1e094f5e14 | [
"0BSD"
] | null | null | null | setup.py | hartungstenio/drf-jsonmask | dde5922ffa09627d447a23cab16a4d1e094f5e14 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import re
import sys
from setuptools import setup
name = 'drf-jsonmask'
package = 'drf_jsonmask'
description = "Implements Google\'s partial response in Django RestFramework (Fork from Zapier's package)"
url = 'https://gi... | 30.487395 | 106 | 0.617144 | from __future__ import unicode_literals
import os
import re
import sys
from setuptools import setup
name = 'drf-jsonmask'
package = 'drf_jsonmask'
description = "Implements Google\'s partial response in Django RestFramework (Fork from Zapier's package)"
url = 'https://github.com/jllorencetti/drf-jsonmask'
author = '... | true | true |
1c1200417c645063abb8f7878eb4b8ff5a1fb3fc | 2,170 | py | Python | app/listings/migrations/0001_initial.py | nuruddinsayeed/django_real_estate_project | 8cd9c1a90455a1f0c2bfa44854a4e795575fea2f | [
"Apache-2.0"
] | null | null | null | app/listings/migrations/0001_initial.py | nuruddinsayeed/django_real_estate_project | 8cd9c1a90455a1f0c2bfa44854a4e795575fea2f | [
"Apache-2.0"
] | null | null | null | app/listings/migrations/0001_initial.py | nuruddinsayeed/django_real_estate_project | 8cd9c1a90455a1f0c2bfa44854a4e795575fea2f | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.8 on 2021-04-12 08:54
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('realtors', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 47.173913 | 118 | 0.576498 |
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('realtors', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='listings',
fields=[
... | true | true |
1c120295481b77efe89b1385c1dd6e0b4ad744e8 | 1,015 | py | Python | tests/chia_log/parsers/test_finished_signage_point_parser.py | johnrees/chiadog | eea174b97f184af9b396389fe447ecfa776c58d8 | [
"MIT"
] | null | null | null | tests/chia_log/parsers/test_finished_signage_point_parser.py | johnrees/chiadog | eea174b97f184af9b396389fe447ecfa776c58d8 | [
"MIT"
] | null | null | null | tests/chia_log/parsers/test_finished_signage_point_parser.py | johnrees/chiadog | eea174b97f184af9b396389fe447ecfa776c58d8 | [
"MIT"
] | null | null | null | # std
import unittest
from pathlib import Path
# project
from src.chia_log.parsers import finished_signage_point_parser
class TestFinishedSignagePointParser(unittest.TestCase):
def setUp(self) -> None:
self.parser = finished_signage_point_parser.FinishedSignagePointParser()
self.example_logs_path... | 33.833333 | 100 | 0.718227 | import unittest
from pathlib import Path
from src.chia_log.parsers import finished_signage_point_parser
class TestFinishedSignagePointParser(unittest.TestCase):
def setUp(self) -> None:
self.parser = finished_signage_point_parser.FinishedSignagePointParser()
self.example_logs_path = Path(__file__... | true | true |
1c1204ec6ac8362bcd364d28b31ce52fc1b6bcae | 7,510 | py | Python | test/functional/rpc_getblockstats.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | 2 | 2021-11-17T23:05:13.000Z | 2021-11-17T23:05:32.000Z | test/functional/rpc_getblockstats.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | null | null | null | test/functional/rpc_getblockstats.py | Bits-Coin/bits-coin | dd8220018f5582e76d43e8c52bd323524e495d8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The BitsCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test getblockstats rpc call
#
from test_framework.test_framework import BitsCoinTestFramework
from t... | 41.491713 | 130 | 0.621039 |
from test_framework.test_framework import BitsCoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
import json
import os
import time
TESTSDIR = os.path.dirname(os.path.realpath(__file__))
class GetblockstatsTest(BitsCoinTestFramework):
start_height = 101
max_s... | true | true |
1c1205f812a43d616f201f925d25dd18472a5545 | 3,991 | py | Python | Tools/scripts/pysource.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Tools/scripts/pysource.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Tools/scripts/pysource.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | #!/usr/bin/env python3
"""\
List python source files.
There are three functions to check whether a file jest a Python source, listed
here przy increasing complexity:
- has_python_ext() checks whether a file name ends w '.py[w]'.
- look_like_python() checks whether the file jest nie binary oraz either has
the '.py[... | 30.465649 | 89 | 0.639439 |
"""\
List python source files.
There are three functions to check whether a file jest a Python source, listed
here przy increasing complexity:
- has_python_ext() checks whether a file name ends w '.py[w]'.
- look_like_python() checks whether the file jest nie binary oraz either has
the '.py[w]' extension albo the ... | false | true |
1c12065a692b4aab57aaca3d693127efa3c5b89c | 1,196 | py | Python | data/p4VQE/R4/benchmark/startPyquil345.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil345.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil345.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=13
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(1) # number=2
pr... | 23 | 64 | 0.602007 | import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(1) prog += H(2) prog += H(3) prog += Y(3) prog += SWA... | true | true |
1c1207d02397f68a1f875201361fef9f9db92ac6 | 5,600 | py | Python | tools/c7n_mailer/c7n_mailer/cli.py | rentacenter/cloud-custodian | 8d581193f851be3e9d988f2ace2cb4061a13417a | [
"Apache-2.0"
] | 1 | 2017-06-26T18:30:22.000Z | 2017-06-26T18:30:22.000Z | tools/c7n_mailer/c7n_mailer/cli.py | rentacenter/cloud-custodian | 8d581193f851be3e9d988f2ace2cb4061a13417a | [
"Apache-2.0"
] | null | null | null | tools/c7n_mailer/c7n_mailer/cli.py | rentacenter/cloud-custodian | 8d581193f851be3e9d988f2ace2cb4061a13417a | [
"Apache-2.0"
] | 1 | 2021-02-16T21:24:09.000Z | 2021-02-16T21:24:09.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import boto3
import functools
import jsonschema
import logging
import yaml
from c7n_mailer import deploy, utils
from c7n_mailer.sqs_queue_processor import MailerSqsQueueProcessor
CONFIG_SCHEMA = {
'type': 'object',... | 39.160839 | 100 | 0.650714 | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import boto3
import functools
import jsonschema
import logging
import yaml
from c7n_mailer import deploy, utils
from c7n_mailer.sqs_queue_processor import MailerSqsQueueProcessor
CONFIG_SCHEMA = {
'type': 'object',... | true | true |
1c1207fd570e2602aa03c12f12dcea7bcd198586 | 8,108 | py | Python | alipay/aop/api/domain/QueryResult.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/QueryResult.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/QueryResult.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class QueryResult(object):
def __init__(self):
self._background_url = None
self._brand_id = None
self._brand_name = None
self._cc = None
self._comp... | 30.481203 | 79 | 0.570301 | import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class QueryResult(object):
def __init__(self):
self._background_url = None
self._brand_id = None
self._brand_name = None
self._cc = None
self._company_id = None
self._company_name = Non... | true | true |
1c1207ffa10e54b2b562312cf6aebfe311edcb34 | 2,322 | py | Python | GP_tutorial/homework3/basic_ga.py | VictorRodriguez/master-computer | b5b1199c8fa1725e2409c75fe365b369187eb397 | [
"Apache-2.0"
] | null | null | null | GP_tutorial/homework3/basic_ga.py | VictorRodriguez/master-computer | b5b1199c8fa1725e2409c75fe365b369187eb397 | [
"Apache-2.0"
] | null | null | null | GP_tutorial/homework3/basic_ga.py | VictorRodriguez/master-computer | b5b1199c8fa1725e2409c75fe365b369187eb397 | [
"Apache-2.0"
] | null | null | null | import random
import argparse
import math
import sys
TARGET_VALUE = None
FILENAME = "data.dat"
def generate_random_population(size):
population = []
min_limit = (size /2) * -1
max_limit = (size /2)
for count in range(0, size):
population.append(random.randint(1, max_limit))
return populat... | 27.317647 | 88 | 0.64944 | import random
import argparse
import math
import sys
TARGET_VALUE = None
FILENAME = "data.dat"
def generate_random_population(size):
population = []
min_limit = (size /2) * -1
max_limit = (size /2)
for count in range(0, size):
population.append(random.randint(1, max_limit))
return populat... | false | true |
1c1208250f3a3eaa8254b2c8e9827e3adf90b1d8 | 2,685 | py | Python | src/wagtailtrans/templatetags/wagtailtrans_tags.py | GrUnicrn/wagtailtrans | 71147499333c3ab5de975913506acc4f7c38c350 | [
"BSD-3-Clause"
] | null | null | null | src/wagtailtrans/templatetags/wagtailtrans_tags.py | GrUnicrn/wagtailtrans | 71147499333c3ab5de975913506acc4f7c38c350 | [
"BSD-3-Clause"
] | null | null | null | src/wagtailtrans/templatetags/wagtailtrans_tags.py | GrUnicrn/wagtailtrans | 71147499333c3ab5de975913506acc4f7c38c350 | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
from django.template import Library
from wagtailtrans.sites import get_languages_for_site
register = Library()
def _get_translations(page, homepage_fallback=True, include_self=True):
"""
Return URLs for translations of provided pages, if
a language isn't available as... | 35.8 | 116 | 0.730354 | from collections import OrderedDict
from django.template import Library
from wagtailtrans.sites import get_languages_for_site
register = Library()
def _get_translations(page, homepage_fallback=True, include_self=True):
site = page.get_site()
available_translations = {}
available_languages = get_languag... | true | true |
1c12099e458a2126334f24ca79c20c39e10e6612 | 19,086 | py | Python | megatron/mpu/tests/test_layers.py | laekov/Megatron-LM | 37cec9af5ce93cd0da05a52513928bf55b70f3ac | [
"MIT"
] | null | null | null | megatron/mpu/tests/test_layers.py | laekov/Megatron-LM | 37cec9af5ce93cd0da05a52513928bf55b70f3ac | [
"MIT"
] | null | null | null | megatron/mpu/tests/test_layers.py | laekov/Megatron-LM | 37cec9af5ce93cd0da05a52513928bf55b70f3ac | [
"MIT"
] | 1 | 2021-01-16T10:10:17.000Z | 2021-01-16T10:10:17.000Z | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... | 35.943503 | 80 | 0.679975 |
from mpu import layers
from commons import set_random_seed
from commons import print_separator
from commons import initialize_distributed
import mpu
from torch.nn.parameter import Parameter
import torch.nn.init as init
import torch
import random
import sys
sys.path.append("../..")
def test_parallel_embedding(model_p... | true | true |
1c120a784a3cae28d455612b4cbfa68575a046e1 | 3,778 | py | Python | 16_mmdet/lib/cfgs/fovea_r101_fpn_4x4_coco.py | rohit0906/Monk_Object_Detection | aa96f0fa4629e12e2730164a571ea41aa0ee2278 | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | 16_mmdet/lib/cfgs/fovea_r101_fpn_4x4_coco.py | rohit0906/Monk_Object_Detection | aa96f0fa4629e12e2730164a571ea41aa0ee2278 | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | 16_mmdet/lib/cfgs/fovea_r101_fpn_4x4_coco.py | rohit0906/Monk_Object_Detection | aa96f0fa4629e12e2730164a571ea41aa0ee2278 | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | # model settings
model = dict(
type='FOVEA',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
s... | 26.605634 | 78 | 0.57729 | model = dict(
type='FOVEA',
pretrained='torchvision://resnet101',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch'),
... | false | true |
1c120a9a176a0a50b20c070fc798cd9b275040d7 | 6,854 | py | Python | tests/test_conv_1d.py | BuildJet/distdl | 28b0dcf2c0a762de924cc310398a2eab9c35297f | [
"BSD-2-Clause"
] | 25 | 2020-06-25T21:11:55.000Z | 2022-03-24T04:56:23.000Z | tests/test_conv_1d.py | BuildJet/distdl | 28b0dcf2c0a762de924cc310398a2eab9c35297f | [
"BSD-2-Clause"
] | 97 | 2020-06-08T17:09:59.000Z | 2022-03-26T00:47:11.000Z | tests/test_conv_1d.py | BuildJet/distdl | 28b0dcf2c0a762de924cc310398a2eab9c35297f | [
"BSD-2-Clause"
] | 8 | 2020-06-08T17:00:54.000Z | 2022-03-20T20:20:24.000Z | import numpy as np
import pytest
from adjoint_test import check_adjoint_test_tight
adjoint_parametrizations = []
# Main functionality
adjoint_parametrizations.append(
pytest.param(
np.arange(0, 3), [1, 1, 3], # P_x_ranks, P_x_shape
[1, 5, 10], # x_global_shape
3, # passed to comm_split_... | 31.440367 | 67 | 0.594397 | import numpy as np
import pytest
from adjoint_test import check_adjoint_test_tight
adjoint_parametrizations = []
adjoint_parametrizations.append(
pytest.param(
np.arange(0, 3), [1, 1, 3], [1, 5, 10], 3, id="distributed",
marks=[pytest.mark.mpi(min_size=3)]
)
... | true | true |
1c120b2aebe9770cc3a2e73f6a651c9568a10eea | 1,703 | py | Python | desktop/core/src/desktop/management/commands/generate_mdl.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | desktop/core/src/desktop/management/commands/generate_mdl.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 4 | 2021-03-11T04:02:00.000Z | 2022-03-27T08:31:56.000Z | desktop/core/src/desktop/management/commands/generate_mdl.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2 | 2019-12-05T17:24:36.000Z | 2021-11-22T21:21:32.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 30.410714 | 74 | 0.689372 | """
Dumps a Cloudera Manager Monitor Descriptor file.
"""
import json
from django.core.management.base import BaseCommand
import desktop.urls
from desktop.lib.metrics import global_registry
class Command(BaseCommand):
def handle(self, *args, **options):
"""Generates a Monitor Descriptor file."""
registry... | false | true |
1c120b7ee701dbc0e85314268a84021abfe5e844 | 1,865 | py | Python | test/nicos_mlz/stressi/test_devices.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | test/nicos_mlz/stressi/test_devices.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | test/nicos_mlz/stressi/test_devices.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 33.909091 | 79 | 0.643968 |
import pytest
from test.utils import approx
session_setup = 'stressi'
class TestTransformedDevices:
@pytest.fixture(scope='function')
def device(self, session):
tthm = session.getDevice('tthm_r')
tthm._attached_dev.maw(50)
yield tthm
session.destroyDevice(tthm)
def te... | true | true |
1c120da16cc59d07725cbdde5237a1e5a7b4ea90 | 14,782 | py | Python | test/data/test_builtin_datasets.py | guyang3532/text | e2fc987ff6a002018040cffac5e0d61c3d0b06c6 | [
"BSD-3-Clause"
] | 1 | 2020-09-11T22:16:01.000Z | 2020-09-11T22:16:01.000Z | test/data/test_builtin_datasets.py | guyang3532/text | e2fc987ff6a002018040cffac5e0d61c3d0b06c6 | [
"BSD-3-Clause"
] | 1 | 2020-12-15T01:12:34.000Z | 2020-12-15T01:12:34.000Z | test/data/test_builtin_datasets.py | guyang3532/text | e2fc987ff6a002018040cffac5e0d61c3d0b06c6 | [
"BSD-3-Clause"
] | 1 | 2020-12-14T21:46:18.000Z | 2020-12-14T21:46:18.000Z | #!/user/bin/env python3
# Note that all the tests in this module require dataset (either network access or cached)
import os
import glob
import shutil
import torchtext.data as data
from torchtext.datasets import AG_NEWS
import torch
from ..common.torchtext_test_case import TorchtextTestCase
def conditional_remove(f):... | 48.94702 | 118 | 0.590989 | import os
import glob
import shutil
import torchtext.data as data
from torchtext.datasets import AG_NEWS
import torch
from ..common.torchtext_test_case import TorchtextTestCase
def conditional_remove(f):
for path in glob.glob(f):
if os.path.isfile(path):
os.remove(path)
elif os.path.is... | true | true |
1c1210479ee686480a3dc5aa50cd38d0e7276740 | 880 | py | Python | scripts/test_signal.py | laojiumen/python-scripts | 89eb4bcd85a25f27922ee3901c4aa1b12c4e3ccc | [
"MIT"
] | 1 | 2016-11-04T03:36:47.000Z | 2016-11-04T03:36:47.000Z | scripts/test_signal.py | laojiumen/python-scripts | 89eb4bcd85a25f27922ee3901c4aa1b12c4e3ccc | [
"MIT"
] | null | null | null | scripts/test_signal.py | laojiumen/python-scripts | 89eb4bcd85a25f27922ee3901c4aa1b12c4e3ccc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
signal信号和linux信号一致,通过 man 7 signal 查询
程序自身只能发送alarm信号
无法注册SIGKILL信号
详情参考python signal或者 man 7 signal
"""
# # # ==========================SIGTSTP===================================
import signal
# # Define signal handler function
# def myHandler(signum, frame):
# print('I received: ', si... | 24.444444 | 74 | 0.5875 |
import signal
# exit()
#
# # register signal.SIGALRM's handler
| true | true |
1c1210f97068915a1e498b857ac293f19d74dba0 | 8,039 | py | Python | Lib/fontTools/unicodedata/__init__.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | null | null | null | Lib/fontTools/unicodedata/__init__.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | null | null | null | Lib/fontTools/unicodedata/__init__.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | null | null | null | from fontTools.misc.textTools import byteord, tostr
import re
from bisect import bisect_right
try:
# use unicodedata backport compatible with python2:
# https://github.com/mikekap/unicodedata2
from unicodedata2 import *
except ImportError: # pragma: no cover
# fall back to built-in unicodedata (possi... | 28.207018 | 90 | 0.642493 | from fontTools.misc.textTools import byteord, tostr
import re
from bisect import bisect_right
try:
from unicodedata2 import *
except ImportError: from unicodedata import *
from . import Blocks, Scripts, ScriptExtensions, OTTags
__all__ = [tostr(s) for s in (
"lookup",
"name",
"... | true | true |
1c12112a08ae85c1581de37b332f0bb9d86bf899 | 1,222 | py | Python | Module03/birthday_countdown.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-james0032 | b64ace56faa0c1fda9bf23788345ada383f606e1 | [
"MIT"
] | null | null | null | Module03/birthday_countdown.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-james0032 | b64ace56faa0c1fda9bf23788345ada383f606e1 | [
"MIT"
] | null | null | null | Module03/birthday_countdown.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-james0032 | b64ace56faa0c1fda9bf23788345ada383f606e1 | [
"MIT"
] | null | null | null | import datetime
def print_header():
print('---------------------------')
print(' BIRTHDAY APP')
print('---------------------------')
print()
def get_birthday_from_user():
print("When were you born? ")
year = int(input("Year [YYYY]: "))
month = int(input("Month [MM]: "))
day = in... | 26 | 87 | 0.620295 | import datetime
def print_header():
print('---------------------------')
print(' BIRTHDAY APP')
print('---------------------------')
print()
def get_birthday_from_user():
print("When were you born? ")
year = int(input("Year [YYYY]: "))
month = int(input("Month [MM]: "))
day = in... | true | true |
1c1213e6b8405f79323c98e8227f6d2c4cb76b8c | 246 | py | Python | amaru/utilities/choose_item.py | TeamSerpentine/angry-birds-level-gen-2020 | 78d6f20dbdc69846a31860ebdf8d4c21bbf3a645 | [
"BSD-3-Clause"
] | 1 | 2021-04-17T09:29:02.000Z | 2021-04-17T09:29:02.000Z | amaru/utilities/choose_item.py | TeamSerpentine/angry-birds-level-gen-2020 | 78d6f20dbdc69846a31860ebdf8d4c21bbf3a645 | [
"BSD-3-Clause"
] | null | null | null | amaru/utilities/choose_item.py | TeamSerpentine/angry-birds-level-gen-2020 | 78d6f20dbdc69846a31860ebdf8d4c21bbf3a645 | [
"BSD-3-Clause"
] | null | null | null | from random import uniform
def choose_item(table):
ran_num = uniform(0.0, 1.0)
selected_num = 0
while ran_num > 0:
selected_num = selected_num + 1
ran_num = ran_num - table[str(selected_num)]
return selected_num
| 22.363636 | 52 | 0.662602 | from random import uniform
def choose_item(table):
ran_num = uniform(0.0, 1.0)
selected_num = 0
while ran_num > 0:
selected_num = selected_num + 1
ran_num = ran_num - table[str(selected_num)]
return selected_num
| true | true |
1c121402f3655ff34cd4037bf444df67f5053a26 | 1,132 | py | Python | src/tools/grit/minify_with_uglify.py | jsylin/naiveproxy | 4ad4827d3ed3e5fd72eded69c14a90028880fc20 | [
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | src/tools/grit/minify_with_uglify.py | jsylin/naiveproxy | 4ad4827d3ed3e5fd72eded69c14a90028880fc20 | [
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | src/tools/grit/minify_with_uglify.py | jsylin/naiveproxy | 4ad4827d3ed3e5fd72eded69c14a90028880fc20 | [
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | #!/usr/bin/env python
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import os
import sys
import tempfile
_HERE_PATH = os.path.dirname(__file__)
_SRC_PATH = os.path... | 25.155556 | 77 | 0.704064 |
from __future__ import print_function
import os
import sys
import tempfile
_HERE_PATH = os.path.dirname(__file__)
_SRC_PATH = os.path.normpath(os.path.join(_HERE_PATH, '..', '..'))
sys.path.append(os.path.join(_SRC_PATH, 'third_party', 'node'))
import node
import node_modules
def Minify(source):
with tempfil... | true | true |
1c1214f4e2b3170e00934c96130a29228f152055 | 44,109 | py | Python | world/tb_basic.py | jamalainm/OTemporaOMores | 92512804ee63847bc4948de676c2bae57d4feeab | [
"BSD-3-Clause"
] | null | null | null | world/tb_basic.py | jamalainm/OTemporaOMores | 92512804ee63847bc4948de676c2bae57d4feeab | [
"BSD-3-Clause"
] | null | null | null | world/tb_basic.py | jamalainm/OTemporaOMores | 92512804ee63847bc4948de676c2bae57d4feeab | [
"BSD-3-Clause"
] | null | null | null | """
Simple turn-based combat system
Contrib - Tim Ashley Jenkins 2017
This is a framework for a simple turn-based combat system, similar
to those used in D&D-style tabletop role playing games. It allows
any character to start a fight in a room, at which point initiative
is rolled and a turn order is established. Each... | 40.135578 | 182 | 0.611871 | import copy
from random import choice
from random import randint
from random import random
from evennia import DefaultCharacter, Command, default_cmds, DefaultScript
from commands.command import MuxCommand
from evennia.commands.default.help import CmdHelp
from commands.latin_commands import which_one
TURN_TIMEOUT = 3 ... | true | true |
1c12154d18474ddfc80fbce7dd80da49159c0c74 | 2,666 | py | Python | src/SimpleReplay/util.py | rmcelroyF8/amazon-redshift-utils | 4c790ec8657c33c94f569e4895ba539c66313750 | [
"Apache-2.0"
] | null | null | null | src/SimpleReplay/util.py | rmcelroyF8/amazon-redshift-utils | 4c790ec8657c33c94f569e4895ba539c66313750 | [
"Apache-2.0"
] | null | null | null | src/SimpleReplay/util.py | rmcelroyF8/amazon-redshift-utils | 4c790ec8657c33c94f569e4895ba539c66313750 | [
"Apache-2.0"
] | null | null | null | import logging
import logging.handlers
import time
import os
LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
def init_logging(level=logging.INFO):
""" Initialize logging to stdio """
logger = logging.getLogger("SimpleReplayLogger")
logger.setLevel(logging.DEBUG)
logging.Formatter.converter = time.gmtime
ch... | 32.91358 | 101 | 0.677419 | import logging
import logging.handlers
import time
import os
LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
def init_logging(level=logging.INFO):
logger = logging.getLogger("SimpleReplayLogger")
logger.setLevel(logging.DEBUG)
logging.Formatter.converter = time.gmtime
ch = logging.StreamHandler()
ch.setLev... | true | true |
1c1215b6ae17506bdc8cab65d1bea29a9e63c679 | 2,011 | py | Python | registry/http/mounts/root/routes/swagger.py | rmb938/tf-registry | bce809ae52e65549b05b836d3f70e8a1de2f2cec | [
"MIT"
] | 3 | 2019-02-25T05:15:39.000Z | 2020-11-26T02:56:10.000Z | registry/http/mounts/root/routes/swagger.py | rmb938/tf-registry | bce809ae52e65549b05b836d3f70e8a1de2f2cec | [
"MIT"
] | null | null | null | registry/http/mounts/root/routes/swagger.py | rmb938/tf-registry | bce809ae52e65549b05b836d3f70e8a1de2f2cec | [
"MIT"
] | null | null | null | import cherrypy
from ingredients_http.route import Route
from registry.http.router import RegistryRouter
class SwaggerRouter(RegistryRouter):
def __init__(self):
super().__init__(uri_base='swagger')
@Route('json')
@cherrypy.config(**{'tools.authentication.on': False})
@cherrypy.tools.json_ou... | 25.782051 | 140 | 0.606166 | import cherrypy
from ingredients_http.route import Route
from registry.http.router import RegistryRouter
class SwaggerRouter(RegistryRouter):
def __init__(self):
super().__init__(uri_base='swagger')
@Route('json')
@cherrypy.config(**{'tools.authentication.on': False})
@cherrypy.tools.json_ou... | true | true |
1c1215b8a3559341cac59ea44d12d2c61ba3abff | 10,706 | py | Python | pirates/effects/RavenFlock.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | pirates/effects/RavenFlock.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | pirates/effects/RavenFlock.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | # File: R (Python 2.4)
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from EffectController import EffectController
from PooledEffect import PooledEffect
from pirat... | 46.547826 | 295 | 0.680927 |
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from EffectController import EffectController
from PooledEffect import PooledEffect
from pirates.piratesgui.GameOptio... | true | true |
1c12160b8dd41bba33c67f5a77427392085973d1 | 17,166 | py | Python | src/puliclient/jobs.py | smaragden/OpenRenderManagement | cf3ab356f96969d7952b60417b48e941955e435c | [
"BSD-3-Clause"
] | 35 | 2015-02-23T23:13:13.000Z | 2021-01-03T05:56:39.000Z | src/puliclient/jobs.py | smaragden/OpenRenderManagement | cf3ab356f96969d7952b60417b48e941955e435c | [
"BSD-3-Clause"
] | 15 | 2015-01-12T12:58:29.000Z | 2016-03-30T13:10:19.000Z | src/puliclient/jobs.py | mikrosimage/OpenRenderManagement | 6f9237a86cb8e4b206313f9c22424c8002fd5e4d | [
"BSD-3-Clause"
] | 20 | 2015-03-18T06:57:13.000Z | 2020-07-01T15:09:36.000Z | '''
Created on Jan 11, 2010
@author: Olivier Derpierre
'''
import sys
import site
import traceback
import logging
import subprocess
try:
import simplejson as json
except ImportError:
import json
#
# Errors specific to command execution
#
class TimeoutError (Exception):
''' Raised when helper execution ... | 35.614108 | 153 | 0.608354 | '''
Created on Jan 11, 2010
@author: Olivier Derpierre
'''
import sys
import site
import traceback
import logging
import subprocess
try:
import simplejson as json
except ImportError:
import json
class TimeoutError (Exception):
''' Raised when helper execution is too long. '''
class CommandDone(Except... | false | true |
1c12167e23c2a73a3591104513528847107fcbba | 16,166 | py | Python | pybind/slxos/v17r_1_01a/routing_system/interface/loopback/ip/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_1_01a/routing_system/interface/loopback/ip/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_1_01a/routing_system/interface/loopback/ip/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 69.681034 | 538 | 0.753371 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
1c12177f9f86a19687f14da4359b842025248c1b | 325 | py | Python | py/count-binary-substrings.py | ckclark/leetcode | 844c6f18d06dcb397db76436e5f4b8ddcb1beddc | [
"Apache-2.0"
] | null | null | null | py/count-binary-substrings.py | ckclark/leetcode | 844c6f18d06dcb397db76436e5f4b8ddcb1beddc | [
"Apache-2.0"
] | null | null | null | py/count-binary-substrings.py | ckclark/leetcode | 844c6f18d06dcb397db76436e5f4b8ddcb1beddc | [
"Apache-2.0"
] | null | null | null | from itertools import groupby
class Solution(object):
def countBinarySubstrings(self, s):
"""
:type s: str
:rtype: int
"""
prev = 0
ans = 0
for k, g in groupby(s):
l = len(list(g))
ans += min(l, prev)
prev = l
return... | 21.666667 | 39 | 0.455385 | from itertools import groupby
class Solution(object):
def countBinarySubstrings(self, s):
prev = 0
ans = 0
for k, g in groupby(s):
l = len(list(g))
ans += min(l, prev)
prev = l
return ans
| true | true |
1c12180e5ef1bb4071abd2383acfb8ad4ee53f39 | 936 | py | Python | trebelge/XMLFileProcessStrategy/CACNamespace.py | askmetoo/trebelge | bff1b13edf41d1a9afd9ddb039f5b4089cb83dd6 | [
"MIT"
] | null | null | null | trebelge/XMLFileProcessStrategy/CACNamespace.py | askmetoo/trebelge | bff1b13edf41d1a9afd9ddb039f5b4089cb83dd6 | [
"MIT"
] | null | null | null | trebelge/XMLFileProcessStrategy/CACNamespace.py | askmetoo/trebelge | bff1b13edf41d1a9afd9ddb039f5b4089cb83dd6 | [
"MIT"
] | 1 | 2022-03-17T21:53:07.000Z | 2022-03-17T21:53:07.000Z | from trebelge.XMLFileProcessStrategy.XMLFileProcessStrategy import XMLFileProcessStrategy
from trebelge.XMLFileProcessStrategy.XMLFileProcessStrategyContext import XMLFileProcessStrategyContext
from trebelge.XMLFileProcessStrategy.XMLNamespaces import XMLNamespaces
class CACNamespace(XMLFileProcessStrategy):
"""
... | 46.8 | 103 | 0.791667 | from trebelge.XMLFileProcessStrategy.XMLFileProcessStrategy import XMLFileProcessStrategy
from trebelge.XMLFileProcessStrategy.XMLFileProcessStrategyContext import XMLFileProcessStrategyContext
from trebelge.XMLFileProcessStrategy.XMLNamespaces import XMLNamespaces
class CACNamespace(XMLFileProcessStrategy):
def... | true | true |
1c12185bc4f26009fa302ad41b046d521dbcf8e3 | 104,037 | py | Python | hintgen/canonicalize/transformations.py | krivers/ITAP-django | dd6af07b02897f5b11305a1888a0b8df1f0f3d8e | [
"MIT"
] | 19 | 2017-06-22T20:58:52.000Z | 2022-03-29T18:30:30.000Z | hintgen/canonicalize/transformations.py | akonoroshi/ITAP-django | 17d690e0f4c3bbc6bb73406bcaedb673225d34e8 | [
"MIT"
] | 1 | 2018-08-30T15:04:28.000Z | 2020-08-12T20:50:30.000Z | hintgen/canonicalize/transformations.py | akonoroshi/ITAP-django | 17d690e0f4c3bbc6bb73406bcaedb673225d34e8 | [
"MIT"
] | 5 | 2019-07-01T12:59:01.000Z | 2021-12-27T05:42:50.000Z | import ast, copy, functools
from ..tools import log
from ..namesets import *
from ..astTools import *
### VARIABLE ANONYMIZATION ###
def updateVariableNames(a, varMap, scopeName, randomCounter, imports):
if not isinstance(a, ast.AST):
return
if type(a) in [ast.FunctionDef, ast.ClassDef]:
if a.name in varMap:
... | 37.504326 | 160 | 0.656132 | import ast, copy, functools
from ..tools import log
from ..namesets import *
from ..astTools import *
def updateVariableNames(a, varMap, scopeName, randomCounter, imports):
if not isinstance(a, ast.AST):
return
if type(a) in [ast.FunctionDef, ast.ClassDef]:
if a.name in varMap:
if not hasattr(a, "originalId... | true | true |
1c1219fc044651cc5ce77a27c2f5a85f7e1ee5ed | 16,452 | py | Python | pyglet/media/drivers/directsound/adaptation.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/media/drivers/directsound/adaptation.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/media/drivers/directsound/adaptation.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2018 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | 37.390909 | 102 | 0.66922 | from __future__ import absolute_import, print_function
import ctypes
import math
import weakref
import pyglet
from . import interface
from pyglet.debug import debug_print
from pyglet.media.events import MediaEvent
from pyglet.media.drivers.base import AbstractAudioDriver, AbstractAudioPlayer
from pyglet.media.drivers... | true | true |
1c121a433f02a89eb2b412e8614d770824242c56 | 214 | py | Python | tests/asp/gringo/modelchecker.007.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/gringo/modelchecker.007.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/gringo/modelchecker.007.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
x(a) | x(b) | y.
x(a) | x(b) | y.
:- not y.
x(p) | x(q).
x(t) :- x(p).
x(t) :- x(q).
x(a) :- x(b), x(t).
x(b) :- x(a).
x(c) :- not x(a).
"""
output = """
{y, x(q), x(t), x(c)}
{y, x(p), x(t), x(c)}
"""
| 13.375 | 21 | 0.317757 | input = """
x(a) | x(b) | y.
x(a) | x(b) | y.
:- not y.
x(p) | x(q).
x(t) :- x(p).
x(t) :- x(q).
x(a) :- x(b), x(t).
x(b) :- x(a).
x(c) :- not x(a).
"""
output = """
{y, x(q), x(t), x(c)}
{y, x(p), x(t), x(c)}
"""
| true | true |
1c121c023ee1c57e8d4d1a763a952093c31683c4 | 3,269 | py | Python | test/TEX/nomencl.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 1 | 2017-01-28T15:39:07.000Z | 2017-01-28T15:39:07.000Z | test/TEX/nomencl.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 4 | 2019-04-11T16:27:45.000Z | 2019-04-11T23:56:30.000Z | test/TEX/nomencl.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 2 | 2018-01-16T11:29:16.000Z | 2020-05-13T16:48:26.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | 28.929204 | 106 | 0.759559 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import TestSCons
test = TestSCons.TestSCons()
latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find latex; skipping test(s).\n")
nomencl = os.system('kpsewhich nomencl.sty')
if not nomencl==0:
test.skip_test("no... | true | true |
1c121c83cb49e0be42a72735ce9cfea33fbd0153 | 33 | py | Python | test/pull/out/bar/transformation/keboola.python-transformation-v2/transformation-with-shared-code/blocks/001-block-1/001-shared-code-used/code.py | admariner/keboola-as-code | 845b35c54bd50e141e7e96aa7aa2966723288569 | [
"MIT"
] | 10 | 2021-06-23T07:40:16.000Z | 2022-02-17T07:14:32.000Z | test/pull/out/bar/transformation/keboola.python-transformation-v2/transformation-with-shared-code/blocks/001-block-1/001-shared-code-used/code.py | keboola/keboola-as-code | 8b4a7b5e748697b6c8871c3aecb35ff2cae75e3b | [
"MIT"
] | 78 | 2021-06-04T08:38:05.000Z | 2022-03-31T06:56:00.000Z | test/template-create/out/my-template/v0/transformation/keboola.python-transformation-v2/transformation-with-shared-code/blocks/001-block-1/001-shared-code-used/code.py | admariner/keboola-as-code | 845b35c54bd50e141e7e96aa7aa2966723288569 | [
"MIT"
] | 4 | 2021-09-03T06:32:23.000Z | 2022-03-22T12:06:02.000Z | # {{:codes/code-with-variables}}
| 16.5 | 32 | 0.666667 | true | true | |
1c121c91657bba9a8f271666dd1d27e0b6d8a1ee | 2,696 | py | Python | sqlalchemy_utils/types/uuid.py | chrishemmings/sqlalchemy-utils | 45eaed86fba09a6ff81d68833757c9b010da73f5 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_utils/types/uuid.py | chrishemmings/sqlalchemy-utils | 45eaed86fba09a6ff81d68833757c9b010da73f5 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_utils/types/uuid.py | chrishemmings/sqlalchemy-utils | 45eaed86fba09a6ff81d68833757c9b010da73f5 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import uuid
from sqlalchemy import types, util
from sqlalchemy.dialects import mssql, postgresql
from .scalar_coercible import ScalarCoercible
class UUIDType(types.TypeDecorator, ScalarCoercible):
"""
Stores a UUID in the database natively when it can and falls back t... | 29.955556 | 82 | 0.619065 | from __future__ import absolute_import
import uuid
from sqlalchemy import types, util
from sqlalchemy.dialects import mssql, postgresql
from .scalar_coercible import ScalarCoercible
class UUIDType(types.TypeDecorator, ScalarCoercible):
impl = types.BINARY(16)
python_type = uuid.UUID
def __init__(self... | true | true |
1c121d5a0eae7b1958bc9ac56c75775bdb1eff9a | 312 | py | Python | .apps/sublime/User/close_others.py | nytai/dotfiles | 2c51f3cea949e0c8849c093d9eaa547563a5ddf0 | [
"MIT"
] | null | null | null | .apps/sublime/User/close_others.py | nytai/dotfiles | 2c51f3cea949e0c8849c093d9eaa547563a5ddf0 | [
"MIT"
] | null | null | null | .apps/sublime/User/close_others.py | nytai/dotfiles | 2c51f3cea949e0c8849c093d9eaa547563a5ddf0 | [
"MIT"
] | null | null | null | import sublime, sublime_plugin
class CloseOthersCommand(sublime_plugin.TextCommand):
def run(self, edit):
window = self.view.window()
group_index, view_index = window.get_view_index(self.view)
window.run_command("close_others_by_index", { "group": group_index, "index": view_index})
| 39 | 97 | 0.727564 | import sublime, sublime_plugin
class CloseOthersCommand(sublime_plugin.TextCommand):
def run(self, edit):
window = self.view.window()
group_index, view_index = window.get_view_index(self.view)
window.run_command("close_others_by_index", { "group": group_index, "index": view_index})
| true | true |
1c121d8239876f9c0adaebd076b7141a0fa189d7 | 777 | py | Python | tests/test_nodes.py | nmichlo/eunomia | 5c6ef13b5af5335d4437867953b5eaa872ac56bb | [
"MIT"
] | 3 | 2021-02-07T17:55:46.000Z | 2021-02-15T11:58:36.000Z | tests/test_nodes.py | nmichlo/eunomia | 5c6ef13b5af5335d4437867953b5eaa872ac56bb | [
"MIT"
] | null | null | null | tests/test_nodes.py | nmichlo/eunomia | 5c6ef13b5af5335d4437867953b5eaa872ac56bb | [
"MIT"
] | null | null | null | from eunomia.config.nodes import SubNode
def test_node_sub_fstrings():
assert SubNode('f""').get_config_value({}, {}, {}) == ''
assert SubNode('f"{1}"').get_config_value({}, {}, {}) == '1'
assert SubNode('f"{1}{[1,2]}"').get_config_value({}, {}, {}) == '1[1, 2]'
assert SubNode('f"{1}{[1,2]*2}"').get_c... | 48.5625 | 86 | 0.514801 | from eunomia.config.nodes import SubNode
def test_node_sub_fstrings():
assert SubNode('f""').get_config_value({}, {}, {}) == ''
assert SubNode('f"{1}"').get_config_value({}, {}, {}) == '1'
assert SubNode('f"{1}{[1,2]}"').get_config_value({}, {}, {}) == '1[1, 2]'
assert SubNode('f"{1}{[1,2]*2}"').get_c... | true | true |
1c121d8d018d4121b749a3b1cf16ba9eafd02e97 | 432 | py | Python | oyProjectManager/ui/__init__.py | gcodebackups/oyprojectmanager | 3085ecbe1cc04a73ec69b4848b789009546feae7 | [
"BSD-2-Clause"
] | 1 | 2017-04-06T03:02:23.000Z | 2017-04-06T03:02:23.000Z | oyProjectManager/ui/__init__.py | gcodebackups/oyprojectmanager | 3085ecbe1cc04a73ec69b4848b789009546feae7 | [
"BSD-2-Clause"
] | null | null | null | oyProjectManager/ui/__init__.py | gcodebackups/oyprojectmanager | 3085ecbe1cc04a73ec69b4848b789009546feae7 | [
"BSD-2-Clause"
] | 2 | 2016-12-02T10:15:08.000Z | 2020-02-15T15:51:21.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Erkan Ozgur Yilmaz
#
# This module is part of oyProjectManager and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
# TODO: Create a unified UI for:
# - version_creator
# - project_manager
# - status_manager
#
#... | 30.857143 | 77 | 0.708333 | true | true | |
1c121ee4b31694a4002fd512888d37b3585c2739 | 14,492 | py | Python | get_free_proxy/main/main.py | zwzw911/get-free-proxy | f50a4297edd23fc72d4fac5d15e85387d18f2d94 | [
"MIT"
] | null | null | null | get_free_proxy/main/main.py | zwzw911/get-free-proxy | f50a4297edd23fc72d4fac5d15e85387d18f2d94 | [
"MIT"
] | null | null | null | get_free_proxy/main/main.py | zwzw911/get-free-proxy | f50a4297edd23fc72d4fac5d15e85387d18f2d94 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# -*- coding:utf-8 -*-
import gevent
from gevent import monkey
# monkey.patch_all()
from requests_html import AsyncHTMLSession
asession = AsyncHTMLSession()
import random
import get_free_proxy.db.MySql as mysql
import get_free_proxy.db.Redis as redis
import get_free_proxy.db.File as file
# #... | 38.645333 | 111 | 0.59281 | import gevent
from gevent import monkey
from requests_html import AsyncHTMLSession
asession = AsyncHTMLSession()
import random
import get_free_proxy.db.MySql as mysql
import get_free_proxy.db.Redis as redis
import get_free_proxy.db.File as file
import get_free_proxy.generator.GenProxy as gen_proxy
import get_free_p... | true | true |
1c121efc1aa148875c51f9b49a592dbb4f1e13ef | 301 | py | Python | conditions.py | canmenzo/pythonCamp | 2add92f4885c5051fe450bb18a9e20aeb16815f5 | [
"MIT"
] | null | null | null | conditions.py | canmenzo/pythonCamp | 2add92f4885c5051fe450bb18a9e20aeb16815f5 | [
"MIT"
] | null | null | null | conditions.py | canmenzo/pythonCamp | 2add92f4885c5051fe450bb18a9e20aeb16815f5 | [
"MIT"
] | null | null | null | istenenKredi = 100000
hesap = 9233
minGerekenHesap = 10000
if hesap>=minGerekenHesap:
print ("kredi verilebilir")
elif hesap>=9000 and hesap<=9500:
print("genel mudure sorulacak")
elif hesap>=9501 and hesap<=9999:
print("mudure sorulacak")
else:
print ("kredi verilemez")
| 23.153846 | 36 | 0.69103 | istenenKredi = 100000
hesap = 9233
minGerekenHesap = 10000
if hesap>=minGerekenHesap:
print ("kredi verilebilir")
elif hesap>=9000 and hesap<=9500:
print("genel mudure sorulacak")
elif hesap>=9501 and hesap<=9999:
print("mudure sorulacak")
else:
print ("kredi verilemez")
| true | true |
1c121f4d02fd07df6770a334ea50091a0edd1b1e | 356 | py | Python | Python/B7-Klatschschalter/01 Wechselschalter.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B7-Klatschschalter/01 Wechselschalter.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B7-Klatschschalter/01 Wechselschalter.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | LED = 0
def on_forever():
global LED
if input.button_is_pressed(Button.A):
if LED == 1:
LED = 0
if LED == 0:
basic.turn_rgb_led_off()
elif LED == 0:
LED = 1
if LED == 1:
basic.set_led_color(0xff0000)
basic.p... | 22.25 | 45 | 0.485955 | LED = 0
def on_forever():
global LED
if input.button_is_pressed(Button.A):
if LED == 1:
LED = 0
if LED == 0:
basic.turn_rgb_led_off()
elif LED == 0:
LED = 1
if LED == 1:
basic.set_led_color(0xff0000)
basic.p... | true | true |
1c12206cffae15c8876db107ee293eaef899942b | 5,497 | py | Python | software/metax/KeyedDataSet.py | sudhaveturi/repo | 7510d31fe27a0e759e12850f281619ce415dd279 | [
"MIT"
] | 1 | 2019-09-03T21:40:24.000Z | 2019-09-03T21:40:24.000Z | software/metax/KeyedDataSet.py | sudhaveturi/repo | 7510d31fe27a0e759e12850f281619ce415dd279 | [
"MIT"
] | null | null | null | software/metax/KeyedDataSet.py | sudhaveturi/repo | 7510d31fe27a0e759e12850f281619ce415dd279 | [
"MIT"
] | null | null | null | __author__ = 'heroico'
import gzip
import logging
from DataSet import DataSet
class KeyedDataSet(DataSet):
def __init__(self, name=None, index=None, data=[], keys=[]):
super(KeyedDataSet, self).__init__(name, index, data)
self.keys = keys
self.values_by_key = {}
if len(keys):
... | 35.237179 | 90 | 0.601601 | __author__ = 'heroico'
import gzip
import logging
from DataSet import DataSet
class KeyedDataSet(DataSet):
def __init__(self, name=None, index=None, data=[], keys=[]):
super(KeyedDataSet, self).__init__(name, index, data)
self.keys = keys
self.values_by_key = {}
if len(keys):
... | true | true |
1c12212733cfc043c63d4f592914c115c86d9863 | 40,110 | py | Python | test/functional/test_framework/messages.py | pw512/peony | 8ae371cf12398f8be2b3862d6d38d66fba16b81e | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | pw512/peony | 8ae371cf12398f8be2b3862d6d38d66fba16b81e | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | pw512/peony | 8ae371cf12398f8be2b3862d6d38d66fba16b81e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 29.384615 | 262 | 0.594665 | from codecs import encode
import copy
import hashlib
from io import BytesIO
import random
import socket
import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 80017
MY_SUBVERSION = b"/python-... | true | true |
1c12213dcab23b1818167ae556e10b294991f30e | 2,583 | py | Python | test/SinGAN/config.py | nowage/ImgAugWithSR | eed90d462d1171f0be809eaf4d54a78fc2cd3893 | [
"MIT"
] | 4 | 2020-12-25T08:09:08.000Z | 2021-03-26T09:16:28.000Z | test/SinGAN/config.py | nowage/ImgAugWithSR | eed90d462d1171f0be809eaf4d54a78fc2cd3893 | [
"MIT"
] | null | null | null | test/SinGAN/config.py | nowage/ImgAugWithSR | eed90d462d1171f0be809eaf4d54a78fc2cd3893 | [
"MIT"
] | 1 | 2021-08-21T03:27:04.000Z | 2021-08-21T03:27:04.000Z | import argparse
def get_arguments():
parser = argparse.ArgumentParser()
#parser.add_argument('--mode', help='task to be done', default='train')
#workspace:
parser.add_argument('--not_cuda', action='store_true', help='disables cuda', default=0)
#load, input, save configurations:
... | 58.704545 | 108 | 0.695316 | import argparse
def get_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('--not_cuda', action='store_true', help='disables cuda', default=0)
parser.add_argument('--netG', default='', help="path to netG (to continue training)")
parser.add_argument('--netD', d... | true | true |
1c1222cfafabb2603732b8d22dc7c8bb0263f89c | 29,621 | py | Python | jcvi/formats/fastq.py | fossabot/jcvi | 86948affd63e94c8327cf117c47d36940b508b68 | [
"BSD-2-Clause"
] | null | null | null | jcvi/formats/fastq.py | fossabot/jcvi | 86948affd63e94c8327cf117c47d36940b508b68 | [
"BSD-2-Clause"
] | null | null | null | jcvi/formats/fastq.py | fossabot/jcvi | 86948affd63e94c8327cf117c47d36940b508b68 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Processing fastq files
"""
from __future__ import print_function
import os.path as op
import sys
import re
import logging
import json
from itertools import islice
from Bio import SeqIO
from Bio.SeqIO.QualityIO import FastqGeneralIterator
from jcvi.formats.fasta imp... | 26.952684 | 88 | 0.537018 |
from __future__ import print_function
import os.path as op
import sys
import re
import logging
import json
from itertools import islice
from Bio import SeqIO
from Bio.SeqIO.QualityIO import FastqGeneralIterator
from jcvi.formats.fasta import must_open, rc
from jcvi.formats.base import DictFile
from jcvi.utils.cboo... | true | true |
1c12232cea30c28bbcddd8703e515c756bd15475 | 3,254 | py | Python | heat/engine/output.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:26.000Z | 2018-07-04T07:59:26.000Z | heat/engine/output.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | heat/engine/output.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 34.617021 | 78 | 0.648125 |
import collections
import copy
import six
from heat.common import exception
from heat.engine import function
FIELDS = (
VALUE, DESCRIPTION,
) = (
'Value', 'Description',
)
class OutputDefinition(object):
def __init__(self, name, value, description=None):
self.name = name
self._value =... | true | true |
1c122386e97dc33d66f0bc57f9692b1b90d914ea | 8,335 | py | Python | converter_util.py | melhabr/edge-model-converter | 26d967d29413d2e8f4bacc8ab2e5809a1289eae0 | [
"MIT"
] | null | null | null | converter_util.py | melhabr/edge-model-converter | 26d967d29413d2e8f4bacc8ab2e5809a1289eae0 | [
"MIT"
] | null | null | null | converter_util.py | melhabr/edge-model-converter | 26d967d29413d2e8f4bacc8ab2e5809a1289eae0 | [
"MIT"
] | null | null | null | import queue
# Returns a GraphCharacteristics object given a tensorflow graphdef, which has the following properties:
# nodes_by_name: A dictionary that maps node names to node objects in the graph
# node_outputs_by_name: A dictionary that maps node names to their respective output node objects
# input_node_names: Li... | 38.587963 | 113 | 0.664787 | import queue
class GraphCharacteristics:
def __init__(self, graph_def):
self.nodes_by_name = {}
self.node_outputs_by_name = {}
for node in graph_def.node:
self.nodes_by_name[node.name] = node
self.node_outputs_by_name[node.name] = []
for n... | true | true |
1c1224310c818887039fa299578943015212a80f | 7,576 | py | Python | lib/backup_service_client/models/repository_cloud_info.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 14 | 2015-02-06T02:47:57.000Z | 2020-03-14T15:06:05.000Z | lib/backup_service_client/models/repository_cloud_info.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 3 | 2019-02-27T19:29:11.000Z | 2021-06-02T02:14:27.000Z | lib/backup_service_client/models/repository_cloud_info.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 108 | 2015-03-26T08:58:49.000Z | 2022-03-21T05:21:39.000Z | # coding: utf-8
"""
Couchbase Backup Service API
This is REST API allows users to remotely schedule and run backups, restores and merges as well as to explore various archives for all there Couchbase Clusters. # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://github.com/swagger-api... | 33.522124 | 185 | 0.625132 |
import pprint
import re
import six
class RepositoryCloudInfo(object):
swagger_types = {
'credentials_name': 'str',
'staging_dir': 'str',
'endpoint': 'str',
'force_path_style': 'bool',
'provider': 'str'
}
attribute_map = {
'credentials_name': 'credential... | true | true |
1c1224482739292ab65b740eb309fa6c516313db | 7,257 | py | Python | kadal/sensitivity_analysis/sobol_ind.py | timjim333/KADAL | 8d190e7a28c83d5d1edffb3f85f1a629a481e47f | [
"BSD-3-Clause"
] | 7 | 2020-07-31T09:59:51.000Z | 2022-01-07T07:47:32.000Z | kadal/sensitivity_analysis/sobol_ind.py | timjim333/KADAL | 8d190e7a28c83d5d1edffb3f85f1a629a481e47f | [
"BSD-3-Clause"
] | 1 | 2021-04-26T05:39:50.000Z | 2021-04-26T08:53:05.000Z | kadal/sensitivity_analysis/sobol_ind.py | timjim333/KADAL | 8d190e7a28c83d5d1edffb3f85f1a629a481e47f | [
"BSD-3-Clause"
] | 3 | 2021-01-26T09:33:06.000Z | 2021-03-27T04:40:56.000Z | import numpy as np
from kadal.misc.sampling.samplingplan import sampling
from kadal.testcase.RA.testcase import evaluate
from copy import deepcopy
class SobolIndices:
"""
Create Sobol Indices for sensitivity analysis
"""
def __init__(self, nvar, krigobj=None, problem=None, ub=None, lb=None, nMC=2e5):
... | 38.194737 | 105 | 0.482293 | import numpy as np
from kadal.misc.sampling.samplingplan import sampling
from kadal.testcase.RA.testcase import evaluate
from copy import deepcopy
class SobolIndices:
def __init__(self, nvar, krigobj=None, problem=None, ub=None, lb=None, nMC=2e5):
self.nvar = nvar
self.krigobj = krigobj
se... | true | true |
1c12249a51acac0a0ae2fd3fc83bf462e18db897 | 7,633 | py | Python | noxfile.py | google/google-resumable-upload-python | 82f9769f3368404d1854dd22eeed34eeb25ea835 | [
"Apache-2.0"
] | null | null | null | noxfile.py | google/google-resumable-upload-python | 82f9769f3368404d1854dd22eeed34eeb25ea835 | [
"Apache-2.0"
] | null | null | null | noxfile.py | google/google-resumable-upload-python | 82f9769f3368404d1854dd22eeed34eeb25ea835 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.410359 | 97 | 0.617058 |
from __future__ import absolute_import
import os
import pathlib
import shutil
import nox
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
SYSTEM_TEST_ENV_VARS = ("GOOGLE_APPLICATION_CREDENTIALS",)
BLACK_VERSION = "black==22.3.0"
GOOGLE_AUTH = "google-auth >= 1.22.0, < 3.0dev"
DEFAULT_PYTHON_VERSION = "... | true | true |
1c1224a545d007b1edc7677869b0b0b1d0768ad7 | 3,282 | py | Python | src/third_party/wiredtiger/test/suite/test_txn13.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 72 | 2020-06-12T06:33:41.000Z | 2021-03-22T03:15:56.000Z | src/third_party/wiredtiger/test/suite/test_txn13.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 9 | 2020-07-02T09:36:49.000Z | 2021-03-25T23:54:00.000Z | src/third_party/wiredtiger/test/suite/test_txn13.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 14 | 2020-06-12T03:08:03.000Z | 2021-02-03T11:43:09.000Z | #!/usr/bin/env python
#
# Public Domain 2014-2018 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... | 37.724138 | 79 | 0.693784 |
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
import wiredtiger, wttest
class test_txn13(wttest.WiredTigerTestCase, suite_subprocess):
logmax = "100K"
tablename = 'test_txn13'
uri = 'table:' + tablename
nops = 1024
create_params = 'key_format=i,value_format=S'... | true | true |
1c1224a9471fb126f164fae05dca4d255af7d043 | 14,512 | py | Python | malaya_speech/train/model/speechsplit/model.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/model/speechsplit/model.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/model/speechsplit/model.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | 1 | 2021-08-19T02:34:41.000Z | 2021-08-19T02:34:41.000Z | import tensorflow as tf
import numpy as np
from ..autovc.model import Postnet
from ..utils import GroupNormalization
def quantize_f0_tf(x, num_bins = 256):
batch_size = tf.shape(x)[0]
x = tf.reshape(x, (-1,))
uv = x <= 0
x = tf.where(uv, tf.zeros_like(x), x)
x = tf.cast(tf.round((x / tf.reduce_max... | 32.981818 | 79 | 0.546858 | import tensorflow as tf
import numpy as np
from ..autovc.model import Postnet
from ..utils import GroupNormalization
def quantize_f0_tf(x, num_bins = 256):
batch_size = tf.shape(x)[0]
x = tf.reshape(x, (-1,))
uv = x <= 0
x = tf.where(uv, tf.zeros_like(x), x)
x = tf.cast(tf.round((x / tf.reduce_max... | true | true |
1c12259c72eabd63cb934f97fc1fe855a8784a0b | 214 | py | Python | src/charma/search/providers/__init__.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-01-16T23:36:10.000Z | 2020-01-16T23:36:10.000Z | src/charma/search/providers/__init__.py | mononobi/imovie-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 24 | 2020-06-08T18:27:04.000Z | 2021-06-06T12:01:39.000Z | src/charma/search/providers/__init__.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-12-20T05:29:04.000Z | 2020-12-20T05:29:04.000Z | # -*- coding: utf-8 -*-
"""
search providers package.
"""
from pyrin.packaging.base import Package
class SearchProvidersPackage(Package):
"""
search providers package class.
"""
NAME = __name__
| 14.266667 | 40 | 0.654206 |
from pyrin.packaging.base import Package
class SearchProvidersPackage(Package):
NAME = __name__
| true | true |
1c122615bd5d8f90cd595425f0b4f2b1370b454e | 7,084 | py | Python | certbot/tests/configuration_test.py | vivithemage/certbot | 828be0071ea1fd41808b56d3a0024637091198bd | [
"Apache-2.0"
] | 16,789 | 2016-05-06T19:49:59.000Z | 2022-03-31T20:01:47.000Z | certbot/tests/configuration_test.py | vivithemage/certbot | 828be0071ea1fd41808b56d3a0024637091198bd | [
"Apache-2.0"
] | 5,737 | 2016-05-06T19:26:43.000Z | 2022-03-31T20:27:38.000Z | certbot/tests/configuration_test.py | vivithemage/certbot | 828be0071ea1fd41808b56d3a0024637091198bd | [
"Apache-2.0"
] | 2,974 | 2016-05-06T19:51:23.000Z | 2022-03-31T21:01:36.000Z | """Tests for certbot.configuration."""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock
from certbot import errors
from certbot._internal import constants
from certbot.compat import misc
from certbot.compat import os
from certbot.tests import util as test_util
... | 42.674699 | 91 | 0.621542 | import unittest
try:
import mock
except ImportError: from unittest import mock
from certbot import errors
from certbot._internal import constants
from certbot.compat import misc
from certbot.compat import os
from certbot.tests import util as test_util
class NamespaceConfigTest(test_util.ConfigTestCase):
... | true | true |
1c122686f9c2d70727a11c7ebec4e2bbc1616eea | 3,703 | py | Python | Python/ag.fibanacci.py | exegonzalez/Inteligencia-Artificial | a8283189937544fd75390c3b0283384319fe27c4 | [
"MIT"
] | null | null | null | Python/ag.fibanacci.py | exegonzalez/Inteligencia-Artificial | a8283189937544fd75390c3b0283384319fe27c4 | [
"MIT"
] | null | null | null | Python/ag.fibanacci.py | exegonzalez/Inteligencia-Artificial | a8283189937544fd75390c3b0283384319fe27c4 | [
"MIT"
] | null | null | null | import random
modelo = [1,1,2,3,5,8,13,21,34,55] #Objetivo a alcanzar
largo = len(modelo) #La longitud del material genetico de cada individuo
num = 10 #La cantidad de individuos que habra en la poblacion
pressure = 3 #Cuantos individuos se seleccionan para reproduccion. Necesariamente mayor que 2
mutation_chance =... | 37.03 | 172 | 0.674588 | import random
modelo = [1,1,2,3,5,8,13,21,34,55] largo = len(modelo) num = 10 pressure = 3 mutation_chance = 0.2 generations = 100
print("\n\nModelo: %s\n"%(modelo))
def individual(min, max):
return[random.randint(min, max) for i in range(largo)]
def crearPoblacion():
return [individual(1,99) for i i... | true | true |
1c12287d600c9484458c0822223da811fbab41e0 | 568 | py | Python | examples/example_SCout.py | holzkohlengrill/SCout | 8fd1eca0607b27d6e0c537b2ea1211d23356edff | [
"MIT"
] | 4 | 2021-04-19T07:49:28.000Z | 2022-01-29T23:48:04.000Z | examples/example_SCout.py | holzkohlengrill/SCout | 8fd1eca0607b27d6e0c537b2ea1211d23356edff | [
"MIT"
] | 1 | 2018-11-13T13:42:18.000Z | 2018-11-13T15:33:56.000Z | examples/example_SCout.py | holzkohlengrill/SCout | 8fd1eca0607b27d6e0c537b2ea1211d23356edff | [
"MIT"
] | null | null | null | """
SCout | Special Character Out
Copyright 2017-2019, Marcel Schmalzl (MSc)
This code is licensed under a MIT license
You should have received a copy of the MIT licence along with this program.
If not see:
* https://github.com/holzkohlengrill/SCout/blob/master/LICENSE
* https://opensource.org/licenses/MIT
"""
from p... | 24.695652 | 75 | 0.751761 |
from pypiscout import SCout as sc
print("\n")
sc.header("Welcome to SCout!")
sc.debug("Some debug message: 0xDEADBEEF")
sc.info("An info message")
sc.wwarning("Weak warnings are supported")
sc.warning("This is a warning")
sc.error("An error occured")
| true | true |
1c1229854c90af9832c000edbb68a435fedcb9d7 | 4,184 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslcertlink.py | mahabs/nitro | be74e1e177f5c205c16126bc9b023f2348788409 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslcertlink.py | mahabs/nitro | be74e1e177f5c205c16126bc9b023f2348788409 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslcertlink.py | mahabs/nitro | be74e1e177f5c205c16126bc9b023f2348788409 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | 28.080537 | 113 | 0.711281 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro... | true | true |
1c1229b0d8b4058e593c7468d01e3c6a7030ff0c | 12,501 | py | Python | cryptoapis/model/endpoint_not_allowed_for_api_key.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | cryptoapis/model/endpoint_not_allowed_for_api_key.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | cryptoapis/model/endpoint_not_allowed_for_api_key.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 44.806452 | 484 | 0.583553 |
import re import sys
from cryptoapis.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiM... | true | true |
1c1229e7f93aac7ba05ac8b5a96a3227f7fc5f8e | 405 | py | Python | swapi_explorer/swapi_explorer/asgi.py | damianfraszczak/swapi_explorer | cc2b48e2d147d616fb6a36a6f3f340a32cb6c27d | [
"MIT"
] | null | null | null | swapi_explorer/swapi_explorer/asgi.py | damianfraszczak/swapi_explorer | cc2b48e2d147d616fb6a36a6f3f340a32cb6c27d | [
"MIT"
] | null | null | null | swapi_explorer/swapi_explorer/asgi.py | damianfraszczak/swapi_explorer | cc2b48e2d147d616fb6a36a6f3f340a32cb6c27d | [
"MIT"
] | null | null | null | """
ASGI config for swapi_explorer project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "swapi_explorer.settings")
application = get_asgi_application()
| true | true |
1c122b4075ea37d3737663e4c2acb710ae2b7e82 | 14,982 | py | Python | hanlp/utils/english_tokenizer.py | SIMSON20/HanLP | 1d201d27b5c4f845de9eb194ed8ce33bd16cf52c | [
"Apache-2.0"
] | 1 | 2020-02-12T07:49:47.000Z | 2020-02-12T07:49:47.000Z | hanlp/utils/english_tokenizer.py | Lankovski/HanLP | 69ad19aa56a656cad007993bb1716b3018d80751 | [
"Apache-2.0"
] | null | null | null | hanlp/utils/english_tokenizer.py | Lankovski/HanLP | 69ad19aa56a656cad007993bb1716b3018d80751 | [
"Apache-2.0"
] | 1 | 2020-01-11T19:56:42.000Z | 2020-01-11T19:56:42.000Z | #!/usr/bin/env python
"""
Regex-based word tokenizers.
Note that small/full/half-width character variants are *not* covered.
If a text were to contains such characters, normalize it first.
A modified version of https://github.com/fnl/segtok
"""
from html import unescape
__author__ = 'Florian Leitner <florian.leitner@... | 42.683761 | 107 | 0.56955 | from html import unescape
__author__ = 'Florian Leitner <florian.leitner@gmail.com>'
from regex import compile, DOTALL, UNICODE, VERBOSE
SENTENCE_TERMINALS = '.!?\u203C\u203D\u2047\u2048\u2049\u3002' \
'\uFE52\uFE57\uFF01\uFF0E\uFF1F\uFF61'
HYPHENS = '\u00AD\u058A\u05BE\u0F0C\u1400\u1806\u2010-\... | true | true |
1c122bdc17966668c7f440ba5b61b31a67fa5cd0 | 361 | py | Python | 2day/Tuple02.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 2day/Tuple02.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 2day/Tuple02.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | # Tuple02.py
a = (10, 20, 30, 40, 50)
b = 60, 70
c = 80,
print(a + b + c)
# a b c는 다 투플
print((a+b+c)[1:-1])
print(type(a+b+c))
d = (10,20,30),90,'A',(40,(50,[60,70],80),100),
print(d)
# d의 타입 : 투플
# d의 길이 : 4
print(d[3][1][1][1])
# d : 70 출력
b = True,
print(type(b), b, len(b))
b = None,
print(type(b), b, len(b))
b... | 13.884615 | 47 | 0.509695 |
a = (10, 20, 30, 40, 50)
b = 60, 70
c = 80,
print(a + b + c)
print((a+b+c)[1:-1])
print(type(a+b+c))
d = (10,20,30),90,'A',(40,(50,[60,70],80),100),
print(d)
print(d[3][1][1][1])
b = True,
print(type(b), b, len(b))
b = None,
print(type(b), b, len(b))
b = None, None
print(type(b), b, len(b))
| true | true |
1c122cb0be8841a7470e19924d5a222bcadd0e48 | 18,014 | py | Python | stsdas/pkg/analysis/slitless/axe/axesrc/axetasks.py | iraf-community/stsdas | 043c173fd5497c18c2b1bfe8bcff65180bca3996 | [
"BSD-3-Clause"
] | 1 | 2020-12-20T10:06:48.000Z | 2020-12-20T10:06:48.000Z | stsdas/pkg/analysis/slitless/axe/axesrc/axetasks.py | spacetelescope/stsdas_stripped | 043c173fd5497c18c2b1bfe8bcff65180bca3996 | [
"BSD-3-Clause"
] | 1 | 2017-09-15T18:02:45.000Z | 2017-09-15T18:02:45.000Z | axesrc/axetasks.py | sosey/axe_help_call | dc7efc06f0c5eacd50bfde149e4e713a94d74187 | [
"BSD-3-Clause"
] | 2 | 2019-10-12T20:01:16.000Z | 2020-11-19T08:04:30.000Z | """
$Revision: 1.16 $ $Date: 2010-06-14 12:53:12 $
Author: Martin Kuemmel
Affiliation: Space Telescope - European Coordinating Facility
"""
from __future__ import absolute_import
__author__ = "Martin Kuemmel <mkuemmel@eso.org>"
__date__ = "$Date: 2010-06-14 12:53:12 $"
__version__ = "$Revision: 1.16 $"
__credits__ = "... | 26.967066 | 131 | 0.586322 | from __future__ import absolute_import
__author__ = "Martin Kuemmel <mkuemmel@eso.org>"
__date__ = "$Date: 2010-06-14 12:53:12 $"
__version__ = "$Revision: 1.16 $"
__credits__ = """This software was developed by the ACS group of the Space Telescope -
European Coordinating Facility (ST-ECF). The ST-ECF is a department ... | true | true |
1c122d27857298e8ab3f37511d8f99c234741799 | 424 | py | Python | frame.py | Hec98/tkinterIntro | 03d33b97aa4fc2d9d12c4590cf17dccdb343980a | [
"MIT"
] | 2 | 2022-01-12T04:25:55.000Z | 2022-01-12T04:31:18.000Z | frame.py | Hec98/tkinterIntro | 03d33b97aa4fc2d9d12c4590cf17dccdb343980a | [
"MIT"
] | null | null | null | frame.py | Hec98/tkinterIntro | 03d33b97aa4fc2d9d12c4590cf17dccdb343980a | [
"MIT"
] | null | null | null | from tkinter import Tk, LabelFrame, Frame, Label, Button
root = Tk()
root.title('Frame')
# frame = LabelFrame(root, text='Login', padx=10, pady=10, borderwidth=3)
# frame = LabelFrame(root, padx=20, pady=10, borderwidth=3)
frame = Frame(root, padx=20, pady=10)
frame.pack(padx=20, pady=20)
lb = Label(frame, text="I'm... | 24.941176 | 73 | 0.695755 | from tkinter import Tk, LabelFrame, Frame, Label, Button
root = Tk()
root.title('Frame')
frame = Frame(root, padx=20, pady=10)
frame.pack(padx=20, pady=20)
lb = Label(frame, text="I'm in a frame")
btn = Button(frame, text='Exit', command=root.quit)
lb.pack()
btn.pack()
root.mainloop()
| true | true |
1c122dc1d85f8cb49fbd0e0e48688d0a9bd99a72 | 74 | py | Python | robotics/estimation/__init__.py | bkolligs/pyrobo | 341687cbed96f839fae682f9ec1c58524d7b35b4 | [
"MIT"
] | 1 | 2022-03-15T20:36:49.000Z | 2022-03-15T20:36:49.000Z | robotics/estimation/__init__.py | bkolligs/pyrobo | 341687cbed96f839fae682f9ec1c58524d7b35b4 | [
"MIT"
] | null | null | null | robotics/estimation/__init__.py | bkolligs/pyrobo | 341687cbed96f839fae682f9ec1c58524d7b35b4 | [
"MIT"
] | null | null | null | from .linear_kalman_filter import *
from .extended_kalman_filter import *
| 24.666667 | 37 | 0.837838 | from .linear_kalman_filter import *
from .extended_kalman_filter import *
| true | true |
1c122de5ccca62aca1b54b96e0385d2ba5e33963 | 35,480 | py | Python | lib/network.py | jcalfee/electrum | 0a943d53ecac271c4156dd337600cd604bfcdce2 | [
"MIT"
] | 1 | 2017-04-25T13:12:21.000Z | 2017-04-25T13:12:21.000Z | lib/network.py | jcalfee/electrum | 0a943d53ecac271c4156dd337600cd604bfcdce2 | [
"MIT"
] | null | null | null | lib/network.py | jcalfee/electrum | 0a943d53ecac271c4156dd337600cd604bfcdce2 | [
"MIT"
] | null | null | null | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 Thomas Voegtlin
#
# 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 rig... | 39.642458 | 138 | 0.593179 |
import time
import Queue
import os
import errno
import sys
import random
import select
import traceback
from collections import defaultdict, deque
from threading import Lock
import socks
import socket
import json
import util
import bitcoin
from bitcoin import *
from interface import Connection, Interface
from blockc... | false | true |
1c122e68363ed58aca51002f6401b50ab137d1f7 | 17,977 | py | Python | tests/test_constants.py | meikomeik/mysql-connector-python | fe81f95bfd284aea11377e6cb8dd79a7fe0f61a8 | [
"Artistic-1.0-Perl"
] | null | null | null | tests/test_constants.py | meikomeik/mysql-connector-python | fe81f95bfd284aea11377e6cb8dd79a7fe0f61a8 | [
"Artistic-1.0-Perl"
] | null | null | null | tests/test_constants.py | meikomeik/mysql-connector-python | fe81f95bfd284aea11377e6cb8dd79a7fe0f61a8 | [
"Artistic-1.0-Perl"
] | null | null | null | # Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also distributed with certain s... | 36.613035 | 79 | 0.582466 |
import tests
from mysql.connector import constants, errors
class Helpers(tests.MySQLConnectorTests):
def test_flag_is_set(self):
data = [
1 << 3,
1 << 5,
1 << 7,
]
flags = 0
for flag in data:
flags |= flag
for flag in dat... | true | true |
1c122eedc315766e0a741beeafc699c06b572037 | 8,979 | py | Python | packages/cloudconvert/cloudconvertrestclient.py | YariKartoshe4ka/sublime-svg-viewer | bb4c7d9df6e41ec68341e51aec77b5afd1964376 | [
"MIT"
] | 2 | 2021-01-19T17:51:22.000Z | 2022-02-24T13:50:27.000Z | packages/cloudconvert/cloudconvertrestclient.py | YariKartoshe4ka/sublime-svg-viewer | bb4c7d9df6e41ec68341e51aec77b5afd1964376 | [
"MIT"
] | 4 | 2021-01-20T12:48:33.000Z | 2022-02-01T12:05:56.000Z | packages/cloudconvert/cloudconvertrestclient.py | YariKartoshe4ka/sublime-svg-viewer | bb4c7d9df6e41ec68341e51aec77b5afd1964376 | [
"MIT"
] | null | null | null | from __future__ import division
import datetime
import requests
import json
import logging
import os
import platform
import ssl
import urllib
import cloudconvert.utils as util
from cloudconvert.exceptions import exceptions
from cloudconvert.config import __version__, __endpoint_map__
log = logging.getLogger(__name__... | 39.209607 | 142 | 0.605524 | from __future__ import division
import datetime
import requests
import json
import logging
import os
import platform
import ssl
import urllib
import cloudconvert.utils as util
from cloudconvert.exceptions import exceptions
from cloudconvert.config import __version__, __endpoint_map__
log = logging.getLogger(__name__... | true | true |
1c12304a97a2d3a0b42faccfaa8b37badd260b5b | 8,023 | py | Python | ml-agents/mlagents/training_analytics_side_channel.py | kazukiave/ml-agents | d3157808e757999596f3d514406b38307e441925 | [
"Apache-2.0"
] | 1 | 2021-10-08T23:00:15.000Z | 2021-10-08T23:00:15.000Z | ml-agents/mlagents/training_analytics_side_channel.py | kazukiave/ml-agents | d3157808e757999596f3d514406b38307e441925 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/training_analytics_side_channel.py | kazukiave/ml-agents | d3157808e757999596f3d514406b38307e441925 | [
"Apache-2.0"
] | null | null | null | import copy
import json
import hmac
import hashlib
import sys
from typing import Optional, Dict
import mlagents_envs
import mlagents.trainers
from mlagents import torch_utils
from mlagents.trainers.settings import RewardSignalType
from mlagents_envs.exception import UnityCommunicationException
from mlagents_envs.side_c... | 43.134409 | 104 | 0.646142 | import copy
import json
import hmac
import hashlib
import sys
from typing import Optional, Dict
import mlagents_envs
import mlagents.trainers
from mlagents import torch_utils
from mlagents.trainers.settings import RewardSignalType
from mlagents_envs.exception import UnityCommunicationException
from mlagents_envs.side_c... | true | true |
1c12314a1afbacf5060f706734ccfd5d3a12987f | 678 | py | Python | PyThief/src/main/__init__.py | AlexReido/TravellingTheifProblem | 34f4c5659207fc9b4bcbb3e3efd303676ed00dc2 | [
"Apache-2.0"
] | 1 | 2021-01-08T12:32:31.000Z | 2021-01-08T12:32:31.000Z | PyThief/src/main/__init__.py | AlexReido/TravellingTheifProblem | 34f4c5659207fc9b4bcbb3e3efd303676ed00dc2 | [
"Apache-2.0"
] | null | null | null | PyThief/src/main/__init__.py | AlexReido/TravellingTheifProblem | 34f4c5659207fc9b4bcbb3e3efd303676ed00dc2 | [
"Apache-2.0"
] | 3 | 2021-01-08T12:32:32.000Z | 2022-01-14T18:21:12.000Z | '''
Created on Dec 1, 2020
@author: areid
'''
from main.Competition import Competition
from main.Problem import Problem
from algorithms.Algorithm import Algorithm
from algorithms.RandomLocalSearch import RandomLocalSearch
from algorithms.NGTA import NGTA
if __name__ == "__main__":
# Problem
p = Problem()
... | 22.6 | 58 | 0.682891 | from main.Competition import Competition
from main.Problem import Problem
from algorithms.Algorithm import Algorithm
from algorithms.RandomLocalSearch import RandomLocalSearch
from algorithms.NGTA import NGTA
if __name__ == "__main__":
p = Problem()
p.readProblem("a280-n279")
print("number of items: "... | true | true |
1c12316fb2aa32e7222037342c9b1c1666d9ac15 | 5,975 | py | Python | CD/cd2021-guiao-3-98597_97484/src/middleware.py | pedromonteiro01/2semestre | 25db062a2a1214c7b905d4e11ea7f5f74cd8f826 | [
"MIT"
] | null | null | null | CD/cd2021-guiao-3-98597_97484/src/middleware.py | pedromonteiro01/2semestre | 25db062a2a1214c7b905d4e11ea7f5f74cd8f826 | [
"MIT"
] | null | null | null | CD/cd2021-guiao-3-98597_97484/src/middleware.py | pedromonteiro01/2semestre | 25db062a2a1214c7b905d4e11ea7f5f74cd8f826 | [
"MIT"
] | null | null | null | """Middleware to communicate with PubSub Message Broker."""
from collections.abc import Callable
from enum import Enum
from queue import LifoQueue, Empty
from typing import Any
import socket, json, pickle
import xml.etree.ElementTree as ET
class MiddlewareType(Enum):
"""Middleware Type."""
CONSUMER = 1
P... | 37.816456 | 128 | 0.603849 | from collections.abc import Callable
from enum import Enum
from queue import LifoQueue, Empty
from typing import Any
import socket, json, pickle
import xml.etree.ElementTree as ET
class MiddlewareType(Enum):
CONSUMER = 1
PRODUCER = 2
class Queue:
def __init__(self, topic, _type=MiddlewareType.CONSUMER... | true | true |
1c1232294fdf381de74260d2562fc5be006a2e8a | 345 | py | Python | recursos_humanos/urls.py | sfajardose/pyxis | f48e6263e71d7faa5abd13f401c37cf9a96fa1f4 | [
"MIT"
] | null | null | null | recursos_humanos/urls.py | sfajardose/pyxis | f48e6263e71d7faa5abd13f401c37cf9a96fa1f4 | [
"MIT"
] | null | null | null | recursos_humanos/urls.py | sfajardose/pyxis | f48e6263e71d7faa5abd13f401c37cf9a96fa1f4 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from .views import LoaderIO
admin.site.site_header = 'Recursos Humanos'
urlpatterns = [
url(r'^', admin.site.urls),
url(r'^recursos/', include('recursos.urls')),
url(r'^loaderio-65e703fb3f6975d8db96b9c226cf3648/', LoaderIO.as_view... | 26.538462 | 94 | 0.727536 | from django.conf.urls import include, url
from django.contrib import admin
from .views import LoaderIO
admin.site.site_header = 'Recursos Humanos'
urlpatterns = [
url(r'^', admin.site.urls),
url(r'^recursos/', include('recursos.urls')),
url(r'^loaderio-65e703fb3f6975d8db96b9c226cf3648/', LoaderIO.as_view... | true | true |
1c12335b90e0482ee0070e19308614b1435833ef | 4,199 | py | Python | addons/github/utils.py | saradbowman/osf.io | 085a3cd581625101e954e6df39940b4c4bd0a5a3 | [
"Apache-2.0"
] | null | null | null | addons/github/utils.py | saradbowman/osf.io | 085a3cd581625101e954e6df39940b4c4bd0a5a3 | [
"Apache-2.0"
] | null | null | null | addons/github/utils.py | saradbowman/osf.io | 085a3cd581625101e954e6df39940b4c4bd0a5a3 | [
"Apache-2.0"
] | null | null | null | import hmac
import uuid
from future.moves.urllib.parse import unquote_plus
import hashlib
from rest_framework import status as http_status
from github3.repos.branch import Branch
from framework.exceptions import HTTPError
from addons.base.exceptions import HookError
from addons.github.api import GitHubClient
MESSAGE... | 31.103704 | 87 | 0.676113 | import hmac
import uuid
from future.moves.urllib.parse import unquote_plus
import hashlib
from rest_framework import status as http_status
from github3.repos.branch import Branch
from framework.exceptions import HTTPError
from addons.base.exceptions import HookError
from addons.github.api import GitHubClient
MESSAGE... | true | true |
1c12367939b7e358376fda39845a2aecca7bdc01 | 3,053 | py | Python | src/bbtronic/cli/__main__.py | werediver/bbtronic | 964a9dac9bdad2171b926d587b1c4df76ced48ed | [
"MIT"
] | 1 | 2020-07-29T09:16:29.000Z | 2020-07-29T09:16:29.000Z | src/bbtronic/cli/__main__.py | werediver/bbtronic | 964a9dac9bdad2171b926d587b1c4df76ced48ed | [
"MIT"
] | null | null | null | src/bbtronic/cli/__main__.py | werediver/bbtronic | 964a9dac9bdad2171b926d587b1c4df76ced48ed | [
"MIT"
] | null | null | null | import random
import time
import requests
from bbtronic.cli.arg_parser import Command, parse_args
from bbtronic.cli.config import load_config
from bbtronic.client import BitbucketClient
from bbtronic.types import BitbucketCompositeError
if __name__ == "__main__":
run_config = parse_args()
config = load_confi... | 44.246377 | 117 | 0.572552 | import random
import time
import requests
from bbtronic.cli.arg_parser import Command, parse_args
from bbtronic.cli.config import load_config
from bbtronic.client import BitbucketClient
from bbtronic.types import BitbucketCompositeError
if __name__ == "__main__":
run_config = parse_args()
config = load_confi... | true | true |
1c12377e1e6df3b54a7f33cf21ab546d1618aa29 | 3,517 | py | Python | Indicators/vama_volume_adjusted_moving_average.py | Desil-sketch/Indicators-for-Jesse | ffe33a217002ea3034696fe38acfa72611d52b4f | [
"MIT"
] | 1 | 2021-12-08T06:34:48.000Z | 2021-12-08T06:34:48.000Z | Indicators/vama_volume_adjusted_moving_average.py | Desil-sketch/Indicators-for-Jesse | ffe33a217002ea3034696fe38acfa72611d52b4f | [
"MIT"
] | null | null | null | Indicators/vama_volume_adjusted_moving_average.py | Desil-sketch/Indicators-for-Jesse | ffe33a217002ea3034696fe38acfa72611d52b4f | [
"MIT"
] | 1 | 2021-11-04T17:40:19.000Z | 2021-11-04T17:40:19.000Z | from jesse.helpers import get_candle_source, slice_candles, np_shift
import numpy as np
from numba import njit
import talib
from typing import Union
from jesse.helpers import get_config, same_length, get_candle_source, slice_candles, np_shift
from collections import namedtuple
'''
https://www.tradingview.com/script/R... | 37.817204 | 241 | 0.621552 | from jesse.helpers import get_candle_source, slice_candles, np_shift
import numpy as np
from numba import njit
import talib
from typing import Union
from jesse.helpers import get_config, same_length, get_candle_source, slice_candles, np_shift
from collections import namedtuple
def vama(candles: np.ndarray, useMeth... | true | true |
1c1237af41b7ebaed4127b94ca4ba1bbdaed6350 | 71,112 | py | Python | controller/modules/BoundedFlood.py | saumitraaditya/ControllersMulticast | a20274e232a8e43e0517e04e369ef340592a578d | [
"MIT"
] | null | null | null | controller/modules/BoundedFlood.py | saumitraaditya/ControllersMulticast | a20274e232a8e43e0517e04e369ef340592a578d | [
"MIT"
] | null | null | null | controller/modules/BoundedFlood.py | saumitraaditya/ControllersMulticast | a20274e232a8e43e0517e04e369ef340592a578d | [
"MIT"
] | null | null | null | # ipop-project
# Copyright 2016, University of Florida
#
# 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, m... | 47.408 | 120 | 0.560004 |
try:
import simplejson as json
except ImportError:
import json
import copy
import socket
import time
import threading
import struct
import uuid
from distutils import spawn
import os
import subprocess
import netifaces as ni
import pickle
import logging
from collections.abc import MutableSet
import random, time,... | true | true |
1c1237eef58ae424a0b619d3a26d2667e8611c00 | 675 | py | Python | tests/test_eeweather_wrapper.py | hshaban/epathermostat_nw | 6fec9402484e1ef7e4e59e2c679d9a8efee99ad6 | [
"MIT"
] | null | null | null | tests/test_eeweather_wrapper.py | hshaban/epathermostat_nw | 6fec9402484e1ef7e4e59e2c679d9a8efee99ad6 | [
"MIT"
] | null | null | null | tests/test_eeweather_wrapper.py | hshaban/epathermostat_nw | 6fec9402484e1ef7e4e59e2c679d9a8efee99ad6 | [
"MIT"
] | null | null | null | import pytest
import pandas as pd
from thermostat_nw.eeweather_wrapper import get_indexed_temperatures_eeweather
from .fixtures.single_stage import thermostat_type_1
def test_get_indexed_temperatures_eeweather_empty_index():
empty_index = pd.DataFrame()
results = get_indexed_temperatures_eeweather("720648", e... | 35.526316 | 78 | 0.795556 | import pytest
import pandas as pd
from thermostat_nw.eeweather_wrapper import get_indexed_temperatures_eeweather
from .fixtures.single_stage import thermostat_type_1
def test_get_indexed_temperatures_eeweather_empty_index():
empty_index = pd.DataFrame()
results = get_indexed_temperatures_eeweather("720648", e... | true | true |
1c12383f080c84416822dcce8831bdf837ceb13c | 3,132 | py | Python | src/oop_ext/foundation/_tests/test_decorators.py | ESSS/oop-ext | 2e8e0be7cfcff8e4f25aa2b603727ec04bd4918b | [
"MIT"
] | 12 | 2019-03-08T12:56:42.000Z | 2021-12-01T18:15:01.000Z | src/oop_ext/foundation/_tests/test_decorators.py | ESSS/oop-ext | 2e8e0be7cfcff8e4f25aa2b603727ec04bd4918b | [
"MIT"
] | 30 | 2019-03-08T19:33:00.000Z | 2022-01-25T20:32:41.000Z | src/oop_ext/foundation/_tests/test_decorators.py | ESSS/oop-ext | 2e8e0be7cfcff8e4f25aa2b603727ec04bd4918b | [
"MIT"
] | 1 | 2019-08-08T16:55:41.000Z | 2019-08-08T16:55:41.000Z | import warnings
from typing import Tuple, Any, List
import pytest
from oop_ext.foundation import is_frozen
from oop_ext.foundation.decorators import Abstract, Deprecated, Implements, Override
def testImplementsFail() -> None:
with pytest.raises(AssertionError):
class IFoo:
def DoIt(self):
... | 22.212766 | 84 | 0.516284 | import warnings
from typing import Tuple, Any, List
import pytest
from oop_ext.foundation import is_frozen
from oop_ext.foundation.decorators import Abstract, Deprecated, Implements, Override
def testImplementsFail() -> None:
with pytest.raises(AssertionError):
class IFoo:
def DoIt(self):
... | true | true |
1c1238c8b5ed622835e0a2d382785e60c3f37722 | 4,734 | py | Python | test/test_aes.py | Naysabots/yt-dlp | bef4697a6a4c225d010125d6ff6dfbfd4fb76e33 | [
"Unlicense"
] | null | null | null | test/test_aes.py | Naysabots/yt-dlp | bef4697a6a4c225d010125d6ff6dfbfd4fb76e33 | [
"Unlicense"
] | null | null | null | test/test_aes.py | Naysabots/yt-dlp | bef4697a6a4c225d010125d6ff6dfbfd4fb76e33 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import base64
from yt_dlp.aes import (
BLOCK_SIZE_BYTES,
aes_cbc_decrypt,
aes_cbc_decrypt_bytes,
aes_cbc_encrypt,
aes_ctr_decrypt,
... | 40.810345 | 125 | 0.674694 | import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import base64
from yt_dlp.aes import (
BLOCK_SIZE_BYTES,
aes_cbc_decrypt,
aes_cbc_decrypt_bytes,
aes_cbc_encrypt,
aes_ctr_decrypt,
aes_ctr_encrypt,
aes_decrypt,
aes_dec... | true | true |
1c123946c791a6b8e2d719157610f13708a6fd7a | 8,792 | py | Python | zoom/sqltools.py | zodman/ZoomFoundry | 87a69f519a2ab6b63aeec0a564ce41259e64f88d | [
"MIT"
] | 8 | 2017-04-10T09:53:15.000Z | 2020-08-16T09:53:14.000Z | zoom/sqltools.py | zodman/ZoomFoundry | 87a69f519a2ab6b63aeec0a564ce41259e64f88d | [
"MIT"
] | 49 | 2017-04-13T22:51:48.000Z | 2019-08-15T22:53:25.000Z | zoom/sqltools.py | zodman/ZoomFoundry | 87a69f519a2ab6b63aeec0a564ce41259e64f88d | [
"MIT"
] | 12 | 2017-04-11T04:16:47.000Z | 2019-08-10T21:41:54.000Z | """
zoom.sql
sql utilities
"""
import datetime
import decimal
import itertools
import zoom
class SearchTerm(object):
def __init__(self, value):
self.value = value
def visit(self, visitor, *a, **k):
return visitor(self, *a, **k)
class LessThan(SearchTerm):
operator = '<'
cl... | 27.219814 | 140 | 0.532075 |
import datetime
import decimal
import itertools
import zoom
class SearchTerm(object):
def __init__(self, value):
self.value = value
def visit(self, visitor, *a, **k):
return visitor(self, *a, **k)
class LessThan(SearchTerm):
operator = '<'
class LessThanOrEqualTo(SearchTerm):
o... | true | true |
1c123a2c8f4bbe97636d7f5cc71be2d7f5579761 | 4,662 | py | Python | test/acquisition/multi_objective/test_analytic.py | ngam/botorch | c6bc8f9a82c4959cc209335fefd8b906023edd1e | [
"MIT"
] | 2,344 | 2019-05-01T04:57:26.000Z | 2022-03-29T17:00:41.000Z | test/acquisition/multi_objective/test_analytic.py | ngam/botorch | c6bc8f9a82c4959cc209335fefd8b906023edd1e | [
"MIT"
] | 942 | 2019-05-01T05:11:30.000Z | 2022-03-31T21:58:24.000Z | test/acquisition/multi_objective/test_analytic.py | ngam/botorch | c6bc8f9a82c4959cc209335fefd8b906023edd1e | [
"MIT"
] | 280 | 2019-05-01T05:14:53.000Z | 2022-03-29T16:00:33.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from botorch.acquisition.multi_objective.analytic import (
ExpectedHypervolumeImprovement,
MultiO... | 40.189655 | 87 | 0.650365 |
import torch
from botorch.acquisition.multi_objective.analytic import (
ExpectedHypervolumeImprovement,
MultiObjectiveAnalyticAcquisitionFunction,
)
from botorch.acquisition.multi_objective.objective import (
AnalyticMultiOutputObjective,
IdentityAnalyticMultiOutputObjective,
IdentityMCMultiOutput... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.