hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
99e1c553ce1c1010df606d2588facca253f4ad64 | 2,128 | py | Python | 033_search_in_rotated_sorted_array.py | Sanster/LeetCode | 5a0c448928b216b49c127c4542ae3cd74c797782 | [
"MIT"
] | 2 | 2018-10-13T15:12:55.000Z | 2020-06-07T09:35:40.000Z | 033_search_in_rotated_sorted_array.py | Sanster/PyLeeCode | 5a0c448928b216b49c127c4542ae3cd74c797782 | [
"MIT"
] | null | null | null | 033_search_in_rotated_sorted_array.py | Sanster/PyLeeCode | 5a0c448928b216b49c127c4542ae3cd74c797782 | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def search(self, nums: List[int], target: int) -> int:
# 1. 找到 peak 点
# 2. 根据 peak 点分两段,在某一段里找 target
l = 0
r = len(nums) - 1
peak = 0
while l < r:
if nums[0] < nums[-1]:
break
mid = (... | 23.130435 | 78 | 0.334117 |
d17b252d360a2763c4ae9806f15fa97ecd64e6eb | 194 | py | Python | modules/devenvironments-21/python/Subasta/Puja.py | pomaretta/PROG2021 | b88c95e1bf5c3375bcfe6c50edfd561cd203c4ff | [
"Apache-2.0"
] | null | null | null | modules/devenvironments-21/python/Subasta/Puja.py | pomaretta/PROG2021 | b88c95e1bf5c3375bcfe6c50edfd561cd203c4ff | [
"Apache-2.0"
] | null | null | null | modules/devenvironments-21/python/Subasta/Puja.py | pomaretta/PROG2021 | b88c95e1bf5c3375bcfe6c50edfd561cd203c4ff | [
"Apache-2.0"
] | 1 | 2022-02-03T09:02:22.000Z | 2022-02-03T09:02:22.000Z | # AUTHOR CARLOS POMARES
from Usuario import Usuario
class Puja:
def __init__(self,usuario: Usuario,cantidad: float) -> None:
self.usuario = usuario
self.cantidad = cantidad | 24.25 | 64 | 0.701031 |
ff07ff429072beb318e7446eb9930cc4bf3c153e | 1,154 | py | Python | NBA Project/venv/Lib/site-packages/_plotly_utils/colors/_swatches.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2019-11-08T07:01:11.000Z | 2019-11-17T10:10:49.000Z | NBA Project/venv/Lib/site-packages/_plotly_utils/colors/_swatches.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | NBA Project/venv/Lib/site-packages/_plotly_utils/colors/_swatches.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | def _swatches(module_names, module_contents):
"""
Returns:
A `Figure` object. This figure demonstrates the color scales and
sequences in this module, as stacked bar charts.
"""
import plotly.graph_objs as go
sequences = [
(k, v)
for k, v in module_contents.items()
... | 30.368421 | 85 | 0.506066 |
887b30d3e9b20d1318ac4ef7f03c2acc5cf664fe | 16,298 | py | Python | PaddleCV/PaddleGAN/trainer/STGAN.py | zhhsplendid/models | 4a11ec1016cd4c4060d0d3603c6c472b79358983 | [
"Apache-2.0"
] | 1 | 2022-02-18T06:46:20.000Z | 2022-02-18T06:46:20.000Z | PaddleCV/PaddleGAN/trainer/STGAN.py | youngboy52/models | a9ad91060377fa2536af89ede1049b5a73830232 | [
"Apache-2.0"
] | null | null | null | PaddleCV/PaddleGAN/trainer/STGAN.py | youngboy52/models | a9ad91060377fa2536af89ede1049b5a73830232 | [
"Apache-2.0"
] | 1 | 2022-02-18T06:46:23.000Z | 2022-02-18T06:46:23.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from network.STGAN_network import STGAN_model
from util import utility
import paddle.fluid as fluid
import sys
import time
import copy
import numpy as np
class GTrainer():
def __init__(self, image_real, la... | 42.553525 | 151 | 0.528592 |
c7b3b5f694c0b6a771f1cc93cb5e64768b154bf8 | 408 | py | Python | app/schemas/user.py | MrHenryD/microservice | c85f9d5ac644b1c8e8118a64f661f7a267bf0d90 | [
"MIT"
] | null | null | null | app/schemas/user.py | MrHenryD/microservice | c85f9d5ac644b1c8e8118a64f661f7a267bf0d90 | [
"MIT"
] | null | null | null | app/schemas/user.py | MrHenryD/microservice | c85f9d5ac644b1c8e8118a64f661f7a267bf0d90 | [
"MIT"
] | null | null | null | from typing import Optional
from pydantic import BaseModel, EmailStr
class UserBase(BaseModel):
first_name: Optional[str] = None
last_name: Optional[str] = None
email: Optional[str] = None
is_active: Optional[bool] = True
class UserCreate(UserBase):
first_name: str
last_name: str
class Us... | 17.73913 | 40 | 0.70098 |
3b52f5c94fb5128dc7d9a50696d9770af42e4434 | 22,707 | py | Python | tests/ED_spinful_fermions_test.py | anton-buyskikh/QuSpin | 4e46b495e399414d9361d659e186492a1ac5b511 | [
"BSD-3-Clause"
] | 195 | 2016-10-24T18:05:31.000Z | 2022-03-29T10:11:56.000Z | tests/ED_spinful_fermions_test.py | cileeky/QuSpin | 769d3817870f6ff55c4283af46f94e11c36f4121 | [
"BSD-3-Clause"
] | 303 | 2016-10-25T20:08:11.000Z | 2022-03-31T16:52:09.000Z | tests/ED_spinful_fermions_test.py | cileeky/QuSpin | 769d3817870f6ff55c4283af46f94e11c36f4121 | [
"BSD-3-Clause"
] | 54 | 2017-01-03T18:47:52.000Z | 2022-03-16T06:54:33.000Z | from __future__ import print_function, division
import sys,os
quspin_path = os.path.join(os.getcwd(),"../")
sys.path.insert(0,quspin_path)
from quspin.operators import hamiltonian
from quspin.basis import spinful_fermion_basis_1d # Hilbert spaces
import numpy as np # general math functions
from itertools import produ... | 30.438338 | 161 | 0.650504 |
f927f1bb5c8e176caa666039d5798c8e60e360d1 | 6,631 | py | Python | fbpmp/data_processing/pid_preparer/union_pid_preparer_cpp.py | benliugithub/fbpcs | 7af984264428058645847135026d474d7e28144e | [
"MIT"
] | null | null | null | fbpmp/data_processing/pid_preparer/union_pid_preparer_cpp.py | benliugithub/fbpcs | 7af984264428058645847135026d474d7e28144e | [
"MIT"
] | null | null | null | fbpmp/data_processing/pid_preparer/union_pid_preparer_cpp.py | benliugithub/fbpcs | 7af984264428058645847135026d474d7e28144e | [
"MIT"
] | null | null | null | #!/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.
# pyre-strict
import asyncio
import logging
import os
import pathlib
import subprocess
import sys
import tempfile
from... | 36.635359 | 90 | 0.621324 |
abbaf5a205d4e67e44c197176a74d77ec67c449b | 497 | py | Python | src/compas_cem/ghpython/components/CEM_NodeSearchKey/code.py | dylau/compas_cem | 643c7d60cb9d6a9999cb96d39c44175cc8662a25 | [
"MIT"
] | null | null | null | src/compas_cem/ghpython/components/CEM_NodeSearchKey/code.py | dylau/compas_cem | 643c7d60cb9d6a9999cb96d39c44175cc8662a25 | [
"MIT"
] | null | null | null | src/compas_cem/ghpython/components/CEM_NodeSearchKey/code.py | dylau/compas_cem | 643c7d60cb9d6a9999cb96d39c44175cc8662a25 | [
"MIT"
] | null | null | null | """
Search a node key in a topology or a form diagram using a point.
"""
from ghpythonlib.componentbase import executingcomponent as component
from compas.utilities import geometric_key
from compas_rhino.geometry import RhinoPoint
class NodeSearchComponent(component):
def RunScript(self, diagram, point):
... | 31.0625 | 69 | 0.730382 |
b7b6a023cee373c3f631de10c2a0ceec21addc5a | 11,462 | py | Python | lib/spack/spack/test/modules/tcl.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | lib/spack/spack/test/modules/tcl.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | lib/spack/spack/test/modules/tcl.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import pytest
import spack.modules.common
import spack.modules.tcl
import spack.spec
mpich_spec_string = 'mpich@3.0.4'
m... | 38.722973 | 120 | 0.653987 |
4570c588e5ba51ad9d3d61ee4318634d765bf875 | 4,324 | py | Python | configs/imvoxelnet/imvoxelnet_total_sunrgbd_fast.py | saic-vul/imvoxelnet | 87e1d5c1e9d291461c9be345836b659d98398e04 | [
"MIT"
] | 136 | 2021-06-03T06:37:56.000Z | 2022-03-29T13:29:03.000Z | configs/imvoxelnet/imvoxelnet_total_sunrgbd_fast.py | saic-vul/imvoxelnet | 87e1d5c1e9d291461c9be345836b659d98398e04 | [
"MIT"
] | 38 | 2021-06-05T12:41:30.000Z | 2022-03-23T07:31:28.000Z | configs/imvoxelnet/imvoxelnet_total_sunrgbd_fast.py | saic-vul/imvoxelnet | 87e1d5c1e9d291461c9be345836b659d98398e04 | [
"MIT"
] | 14 | 2021-06-04T11:37:32.000Z | 2022-02-10T03:39:20.000Z | model = dict(
type='ImVoxelNet',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
style='pytorch... | 32.02963 | 111 | 0.611471 |
1d7e39f658345f553ea0f9b9d39d7dfb18e7093b | 11,998 | py | Python | scripts/nmapscan.py | maaren/pynessus | 21afdab52c309610c82e8e69e41dc67e7938b17c | [
"Apache-2.0"
] | null | null | null | scripts/nmapscan.py | maaren/pynessus | 21afdab52c309610c82e8e69e41dc67e7938b17c | [
"Apache-2.0"
] | null | null | null | scripts/nmapscan.py | maaren/pynessus | 21afdab52c309610c82e8e69e41dc67e7938b17c | [
"Apache-2.0"
] | null | null | null | import sys
import os
import logging
import ConfigParser
import time
import socket
import xml.etree.ElementTree
from optparse import OptionParser
from logging.handlers import WatchedFileHandler
from datetime import datetime
from pynessus.nessus import Nessus
class NessusRunner:
"""
NessusRunner
"""
de... | 42.246479 | 146 | 0.52142 |
a05002aacd361913ddc14fdbcf8f1ea5f43a5b04 | 4,123 | py | Python | uitestcore/waiter.py | talawson05/ui-test-core | 6578398d6cfad97cee552f676a027b8b37755a73 | [
"MIT"
] | 8 | 2019-09-16T14:31:38.000Z | 2022-02-03T21:26:04.000Z | uitestcore/waiter.py | talawson05/ui-test-core | 6578398d6cfad97cee552f676a027b8b37755a73 | [
"MIT"
] | 12 | 2019-09-13T14:47:26.000Z | 2022-01-10T11:24:52.000Z | uitestcore/waiter.py | talawson05/ui-test-core | 6578398d6cfad97cee552f676a027b8b37755a73 | [
"MIT"
] | 4 | 2019-09-16T14:49:53.000Z | 2022-02-02T15:42:01.000Z | """
Created by Tony Lawson
"""
import logging
import time
from selenium.webdriver.support import wait
from selenium.webdriver.support.expected_conditions import presence_of_element_located, alert_is_present
from selenium.webdriver.support.expected_conditions import visibility_of_element_located
from selenium.webdriver.... | 45.307692 | 125 | 0.708707 |
ada8dfd99809a4c7bd191acb0478331ba9a4ac75 | 906 | py | Python | tests/core/fs/test_supported_files_iter.py | nekto-nekto/imgfind | 2e0c3853c564f58e514dd4b30c2fed951ec8fde0 | [
"WTFPL"
] | 1 | 2020-09-29T11:50:11.000Z | 2020-09-29T11:50:11.000Z | tests/core/fs/test_supported_files_iter.py | nekto-nekto/imgfind | 2e0c3853c564f58e514dd4b30c2fed951ec8fde0 | [
"WTFPL"
] | null | null | null | tests/core/fs/test_supported_files_iter.py | nekto-nekto/imgfind | 2e0c3853c564f58e514dd4b30c2fed951ec8fde0 | [
"WTFPL"
] | 1 | 2020-10-02T19:53:24.000Z | 2020-10-02T19:53:24.000Z | # coding=utf-8
import os
from imgfind.core.fs import supported_files_iter
from tests.conftest import assets_path
assets_files_count = os.listdir
def test_recursive():
result = tuple(supported_files_iter(assets_path, recursive=True))
assert len(result) == 15
for path in result:
assert os.path.i... | 22.097561 | 83 | 0.700883 |
2bdc2d0ecc86cf70f2dfcf9fb274ee6c8b8a54b9 | 1,515 | py | Python | test/test_customer.py | scubawhere/scubawhere-api-python-client | 9f8578e251492c7667f785df7b7c9d66e71f5c8e | [
"Apache-2.0"
] | null | null | null | test/test_customer.py | scubawhere/scubawhere-api-python-client | 9f8578e251492c7667f785df7b7c9d66e71f5c8e | [
"Apache-2.0"
] | null | null | null | test/test_customer.py | scubawhere/scubawhere-api-python-client | 9f8578e251492c7667f785df7b7c9d66e71f5c8e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Scubawhere API Documentation
This is the documentation for scubawhere's RMS API. This API is only to be used by authorized parties with valid auth tokens. [Learn about scubawhere](http://www.scubawhere.com) to become an authorized consumer of our API
OpenAPI spec version: 1.0.0
... | 28.055556 | 227 | 0.719472 |
4b04e7c252b5cd2a78578bacb1dc21e3b137f905 | 7,485 | py | Python | src/hdx/location/currency.py | OCHA-DAP/hdx-python-country | fd458f0971441db067128f9576e8d71922c98dd1 | [
"MIT"
] | 14 | 2018-01-06T22:17:32.000Z | 2022-01-15T16:25:43.000Z | src/hdx/location/currency.py | OCHA-DAP/hdx-python-country | fd458f0971441db067128f9576e8d71922c98dd1 | [
"MIT"
] | 9 | 2018-01-08T13:24:33.000Z | 2022-03-08T00:50:24.000Z | src/hdx/location/currency.py | OCHA-DAP/hdx-python-country | fd458f0971441db067128f9576e8d71922c98dd1 | [
"MIT"
] | 8 | 2018-01-06T22:14:54.000Z | 2021-11-19T19:12:21.000Z | """Currency conversion"""
import logging
from datetime import datetime
from typing import Optional, Union
import exchangerates
from hdx.utilities.downloader import Download, DownloadError
from hdx.utilities.path import get_temp_dir
from hdx.utilities.retriever import Retrieve
logger = logging.getLogger(__name__)
cl... | 32.402597 | 140 | 0.59145 |
29d9b40a4d4754b8c60358d21f6910586a74a227 | 2,684 | py | Python | src/harness/reference_models/geo/drive.py | nirajankeybridge/Spectrum-Access-System | e4e157f3b8fc9f29cb6fbb283acc3a7cbb1212e1 | [
"Apache-2.0"
] | null | null | null | src/harness/reference_models/geo/drive.py | nirajankeybridge/Spectrum-Access-System | e4e157f3b8fc9f29cb6fbb283acc3a7cbb1212e1 | [
"Apache-2.0"
] | null | null | null | src/harness/reference_models/geo/drive.py | nirajankeybridge/Spectrum-Access-System | e4e157f3b8fc9f29cb6fbb283acc3a7cbb1212e1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2018 SAS Project Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 31.209302 | 79 | 0.765276 |
9d040b34546a8090dec2e09446471621c2e3919b | 16,728 | py | Python | sdk/python/pulumi_azure_native/datashare/v20191101/adls_gen2_file_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/v20191101/adls_gen2_file_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/v20191101/adls_gen2_file_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 42.673469 | 903 | 0.643412 |
344a4e99cd8502c50904952786c0be482125a299 | 12,846 | py | Python | airflow/www/utils.py | apoorvanand/incubator-airflow | 6e520704f6a5d105c95fcb8e5a7ec06b61e0f002 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/www/utils.py | apoorvanand/incubator-airflow | 6e520704f6a5d105c95fcb8e5a7ec06b61e0f002 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/www/utils.py | apoorvanand/incubator-airflow | 6e520704f6a5d105c95fcb8e5a7ec06b61e0f002 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-03-09T18:47:58.000Z | 2019-03-09T18:47:58.000Z | # -*- 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 required by applicable law or agreed to in writing, software
... | 33.279793 | 90 | 0.559007 |
086e6b8078011a618ac1ac96c5ef50387ecded76 | 5,391 | py | Python | etl/vcf2json.py | inab/dataportal | 1514977e2cc03756b926a0a035966bc4330fda7d | [
"MIT"
] | null | null | null | etl/vcf2json.py | inab/dataportal | 1514977e2cc03756b926a0a035966bc4330fda7d | [
"MIT"
] | null | null | null | etl/vcf2json.py | inab/dataportal | 1514977e2cc03756b926a0a035966bc4330fda7d | [
"MIT"
] | null | null | null | import vcf
import sys
import json
import re
import httplib
from optparse import OptionParser
def http(method, path, data):
""" Execute a Generic HTTP Request against ElasticSearch """
conn = httplib.HTTPConnection(HOST)
conn.request(method, path, data)
return conn.getresponse()
def bulk(data):
... | 25.429245 | 136 | 0.604155 |
7c31c62ee430d67e4cc02b08c7664ab5253491c5 | 10,546 | py | Python | com2sem/tdc.py | NeclusMandarius/com2sem | f66de259c607b0c679785901fc34fdaa9e5b191f | [
"MIT"
] | null | null | null | com2sem/tdc.py | NeclusMandarius/com2sem | f66de259c607b0c679785901fc34fdaa9e5b191f | [
"MIT"
] | null | null | null | com2sem/tdc.py | NeclusMandarius/com2sem | f66de259c607b0c679785901fc34fdaa9e5b191f | [
"MIT"
] | 1 | 2021-06-09T09:12:23.000Z | 2021-06-09T09:12:23.000Z | #!/usr/bin/python3
# Author: Sebastian Schmidt
# Date: 14.02.2021
import csv
import os
from .conf import Configuration
from tkinter import *
from tkinter import filedialog
from tkinter import ttk, messagebox
class TrainingDataCreator:
configuration: Configuration = None
inverse_mapping = None
training... | 37.935252 | 114 | 0.577849 |
8a52e66ef8eb1d7725ffa48859b4d23ed2900673 | 947 | py | Python | amonone/web/apps/processes/models.py | richardsonlima/amonone | c882215aa3b970db8f4da1eb7789b6199cf4610a | [
"MIT"
] | 1 | 2015-01-13T08:35:06.000Z | 2015-01-13T08:35:06.000Z | amonone/web/apps/processes/models.py | demogorgonz/amonone | c882215aa3b970db8f4da1eb7789b6199cf4610a | [
"MIT"
] | 1 | 2021-03-20T05:42:52.000Z | 2021-03-20T05:42:52.000Z | amonone/web/apps/processes/models.py | demogorgonz/amonone | c882215aa3b970db8f4da1eb7789b6199cf4610a | [
"MIT"
] | null | null | null | from amonone.web.apps.core.basemodel import BaseModel
class ProcessModel(BaseModel):
def __init__(self):
super(ProcessModel, self).__init__()
def get_process_data(self, processes, date_from, date_to,):
collection = self.mongo.get_collection('processes')
data = collection.find({"time": {"$gte": date_from,"$... | 23.675 | 96 | 0.656811 |
b609015d93c181f00ae34607415a379804fb3f30 | 1,853 | py | Python | main.py | fullmetalstug/sdstate-cubesat | 85456016b8c5981f3f018fdbfa4856fc61b80d0c | [
"MIT"
] | 1 | 2019-11-03T23:07:49.000Z | 2019-11-03T23:07:49.000Z | main.py | fullmetalstug/sdstate-cubesat | 85456016b8c5981f3f018fdbfa4856fc61b80d0c | [
"MIT"
] | null | null | null | main.py | fullmetalstug/sdstate-cubesat | 85456016b8c5981f3f018fdbfa4856fc61b80d0c | [
"MIT"
] | 2 | 2020-02-27T15:48:33.000Z | 2020-12-23T23:46:33.000Z | import time
import serial
import csv
from smbus import SMBus
import lib_MPL3115A2
serialport = serial.Serial(
port='/dev/ttyACM0',
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
deg = u'\N{DEGREE SIGN}'
counter = 0
#import main... | 30.883333 | 148 | 0.604965 |
f8f8ce19dec8e600ed41dc820bb47d44fbde6e0c | 272 | py | Python | law/contrib/lsf/__init__.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | law/contrib/lsf/__init__.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | law/contrib/lsf/__init__.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# flake8: noqa
"""
LSF contrib functionality.
"""
__all__ = ["LSFJobManager", "LSFJobFileFactory", "LSFWorkflow"]
# provisioning imports
from law.contrib.lsf.job import LSFJobManager, LSFJobFileFactory
from law.contrib.lsf.workflow import LSFWorkflow
| 18.133333 | 64 | 0.764706 |
6274aa307163fbbcbfaa2869df04558d7d3cc371 | 5,390 | py | Python | tools/data_clearing.py | Duxiaopeng0712/VuShop_Interface_Test | aa8bf55bbd716ba85abcaff43b1c53d4bccc860d | [
"MIT"
] | 86 | 2020-08-12T03:33:04.000Z | 2022-03-28T12:21:56.000Z | tools/data_clearing.py | Duxiaopeng0712/VuShop_Interface_Test | aa8bf55bbd716ba85abcaff43b1c53d4bccc860d | [
"MIT"
] | 7 | 2020-10-14T11:51:52.000Z | 2021-08-17T07:33:35.000Z | tools/data_clearing.py | Duxiaopeng0712/VuShop_Interface_Test | aa8bf55bbd716ba85abcaff43b1c53d4bccc860d | [
"MIT"
] | 40 | 2020-08-31T08:14:02.000Z | 2022-03-01T14:34:06.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2021/1/19 11:44
@Author : zy7y
@ProjectName : apiAutoTest
@File : data_clearing.py
@Software : PyCharm
@Github : https://github.com/zy7y
@Blog : https://www.cnblogs.com/zy7y
"""
import os
from datetime import datetime
import paramiko
from tools.read_file impor... | 37.430556 | 229 | 0.602968 |
774b1fc25ede203c3dc08c2d291aa23c55f74064 | 477 | py | Python | test/test_db_matches_ui.py | Zaichkov/python_training | be8aff0b38c5a93c5574762ce5c8c27e6fe11b5a | [
"Apache-2.0"
] | null | null | null | test/test_db_matches_ui.py | Zaichkov/python_training | be8aff0b38c5a93c5574762ce5c8c27e6fe11b5a | [
"Apache-2.0"
] | null | null | null | test/test_db_matches_ui.py | Zaichkov/python_training | be8aff0b38c5a93c5574762ce5c8c27e6fe11b5a | [
"Apache-2.0"
] | null | null | null | from model.group import Group
from timeit import timeit
def test_group_list(app, orm):
# print(timeit(lambda: app.group.get_group_list(), number=1))
ui_list = app.group.get_group_list()
def clean(group):
return Group(id=group.id, name=group.name.strip())
# print(timeit(lambda: db.get_group_l... | 29.8125 | 87 | 0.708595 |
fe5c278d11f0dfe3ee5db7fb80b30da8780f7519 | 474 | py | Python | updated/catkin_ws/build/task_assembly/catkin_generated/pkg.installspace.context.pc.py | JisuHann/Point-Cloud--Grasp | 083244632412709dbc29ac7841b6a837e4ed3cb6 | [
"BSD-2-Clause"
] | null | null | null | updated/catkin_ws/build/task_assembly/catkin_generated/pkg.installspace.context.pc.py | JisuHann/Point-Cloud--Grasp | 083244632412709dbc29ac7841b6a837e4ed3cb6 | [
"BSD-2-Clause"
] | null | null | null | updated/catkin_ws/build/task_assembly/catkin_generated/pkg.installspace.context.pc.py | JisuHann/Point-Cloud--Grasp | 083244632412709dbc29ac7841b6a837e4ed3cb6 | [
"BSD-2-Clause"
] | 1 | 2021-03-31T06:27:31.000Z | 2021-03-31T06:27:31.000Z | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "${prefix}/include".split(';') if "${prefix}/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;std_msgs;geometry_msgs;sensor_msgs;trajectory_msgs".replace(';', ' ')
PKG_CONFIG_LIBRARIES_W... | 52.666667 | 111 | 0.742616 |
7228fb0c6bf51815f3c674d63f6b6cc39cb2401a | 15,552 | py | Python | test/on_yubikey/test_piv.py | blaisep/yubikey-manager | 90b4c49a735d90a6e9da790390ad04aa25bfae7a | [
"BSD-2-Clause"
] | null | null | null | test/on_yubikey/test_piv.py | blaisep/yubikey-manager | 90b4c49a735d90a6e9da790390ad04aa25bfae7a | [
"BSD-2-Clause"
] | 1 | 2018-05-07T07:34:23.000Z | 2018-05-07T13:44:29.000Z | test/on_yubikey/test_piv.py | blaisep/yubikey-manager | 90b4c49a735d90a6e9da790390ad04aa25bfae7a | [
"BSD-2-Clause"
] | null | null | null | from __future__ import unicode_literals
import datetime
import unittest
from binascii import a2b_hex
from cryptography import x509
from cryptography.hazmat.primitives import serialization
from ykman.driver_ccid import APDUError
from ykman.piv import (ALGO, PIN_POLICY, PivController, SLOT, TOUCH_POLICY)
from ykman.util... | 37.028571 | 102 | 0.708976 |
ad4090ec21b5af5c97e9702e7760b3023dd82c31 | 16,030 | py | Python | src/compas/plugins.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas/plugins.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | src/compas/plugins.py | Sam-Bouten/compas | 011c7779ded9b69bb602568b470bb0443e336f62 | [
"MIT"
] | null | null | null | # The COMPAS plugin system owes a lot to pluggy, the pytest plugin framework
# There are portions of code loosely based on pluggy's
# and while it is not strictly derivative work, we include
# their license and copyright notice to give credit where credit is due.
#
# MIT license
# Copyright (c) 2015 holger krekel (rath... | 33.119835 | 144 | 0.623955 |
79e4cc9ef0e83bd5fd36b1d2fd3a87e5a4a62b93 | 977 | py | Python | clip/ViT-B-32-cpu/code/__torch__/multimodal/model/multimodal_transformer/___torch_mangle_9460.py | shawwn/CLIP | ba33b4eb956e6f507b4b39468b3b7336ac2260a1 | [
"MIT"
] | 6 | 2021-01-09T14:34:17.000Z | 2021-06-13T06:46:43.000Z | clip/ViT-B-32-cpu/code/__torch__/multimodal/model/multimodal_transformer/___torch_mangle_9460.py | shawwn/CLIP | ba33b4eb956e6f507b4b39468b3b7336ac2260a1 | [
"MIT"
] | null | null | null | clip/ViT-B-32-cpu/code/__torch__/multimodal/model/multimodal_transformer/___torch_mangle_9460.py | shawwn/CLIP | ba33b4eb956e6f507b4b39468b3b7336ac2260a1 | [
"MIT"
] | 2 | 2021-01-09T10:30:04.000Z | 2021-01-09T18:43:29.000Z | class LayerNorm(Module):
__parameters__ = ["weight", "bias", ]
__buffers__ = []
weight : Tensor
bias : Tensor
training : bool
def forward(self: __torch__.multimodal.model.multimodal_transformer.___torch_mangle_9460.LayerNorm,
argument_1: Tensor) -> Tensor:
_0 = self.bias
_1 = self.weight
inp... | 42.478261 | 102 | 0.691914 |
5f541ad2eac97da82b34a15e5a026f3051c6afc6 | 1,846 | py | Python | polls/models.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | polls/models.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | polls/models.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | import datetime
from django.db import models
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200) #What is your name?
pub_date = models.DateTimeField('date published')#date
def __str__(self):
return self.question_text
def was_publishe... | 32.385965 | 83 | 0.737811 |
06a050200c46c99a02812d8c78a6491aa4f52046 | 401 | py | Python | demo/wsgi.py | LuoBingjun/Pic_demo | 67df08bb60d739f60ef55ae672331dfc9f4b91e9 | [
"MIT"
] | 1 | 2019-11-07T07:38:21.000Z | 2019-11-07T07:38:21.000Z | demo/wsgi.py | LuoBingjun/Pic_demo | 67df08bb60d739f60ef55ae672331dfc9f4b91e9 | [
"MIT"
] | null | null | null | demo/wsgi.py | LuoBingjun/Pic_demo | 67df08bb60d739f60ef55ae672331dfc9f4b91e9 | [
"MIT"
] | null | null | null | """
WSGI config for demo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 23.588235 | 79 | 0.750623 |
6ee28e041cf561cb06c76f0cd5104eb59133854b | 712 | py | Python | example/old/elu.py | SeanMabli/aiinpy | bd332fce454c489e236878c9da91bb86ec6dda14 | [
"MIT"
] | null | null | null | example/old/elu.py | SeanMabli/aiinpy | bd332fce454c489e236878c9da91bb86ec6dda14 | [
"MIT"
] | null | null | null | example/old/elu.py | SeanMabli/aiinpy | bd332fce454c489e236878c9da91bb86ec6dda14 | [
"MIT"
] | null | null | null | import numpy as np
class elu:
def __init__(self, alpha):
self.alpha = alpha
self.forwardequationvectorized = np.vectorize(self.forwardequation, otypes=[float])
self.backwardequationvectorized = np.vectorize(self.backwardequation, otypes=[float])
def forward(self, input):
return self.forwardequatio... | 28.48 | 89 | 0.698034 |
fa6ff38642c728bde95867f3252daf9d9c876800 | 879 | py | Python | main.py | PySideProjects/StartUpCompanyDataScraper | e6712477c02dbefcd7c42aa65e0b4ea90e4d46ea | [
"MIT"
] | null | null | null | main.py | PySideProjects/StartUpCompanyDataScraper | e6712477c02dbefcd7c42aa65e0b4ea90e4d46ea | [
"MIT"
] | 2 | 2021-03-31T19:25:52.000Z | 2021-12-13T20:28:11.000Z | main.py | PySideProjects/StartUpCompanyDataScraper | e6712477c02dbefcd7c42aa65e0b4ea90e4d46ea | [
"MIT"
] | null | null | null | import lxml.html
import requests
def get_request(url, num):
return requests.get("{}?page={}".format(url, num))
def get_companies(doc, pattern):
companies = doc.xpath('//*[@class="startupCard__details__name"]/text()')
return companies
def set_companies(ret_companies, companies):
return [ ret_compan... | 25.114286 | 89 | 0.687144 |
8efb473cf54d35eeae02cec91f93b04025018458 | 1,768 | py | Python | homeassistant/components/iaqualink/switch.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/components/iaqualink/switch.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 19 | 2020-01-29T23:21:07.000Z | 2021-07-23T23:26:51.000Z | homeassistant/components/iaqualink/switch.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """Support for Aqualink pool feature switches."""
import logging
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from . import AqualinkEntity, refresh_system
from .const import DOMAIN as AQ... | 29.466667 | 74 | 0.66233 |
7df4c22f1dc16b19a40b7a5a823651eadc6d57a7 | 2,115 | py | Python | TuckerLinux.py | OhLyln/Tucker-A-Shapes-Game | ba306261ac754a40809bb20a349a354d6f9240c1 | [
"MIT"
] | 1 | 2017-01-15T01:33:05.000Z | 2017-01-15T01:33:05.000Z | TuckerLinux.py | OhLyln/Tucker-A-Shapes-Game | ba306261ac754a40809bb20a349a354d6f9240c1 | [
"MIT"
] | null | null | null | TuckerLinux.py | OhLyln/Tucker-A-Shapes-Game | ba306261ac754a40809bb20a349a354d6f9240c1 | [
"MIT"
] | null | null | null | # Some needed modules for this program:
import turtle
import os
def TuckerPlay():
# Welcomes the user to the program
print("Welcome to Tucker! \n")
# Needed for my infinite, but breakable, while-loop, and to create the shape
sides = 0
# The while-loop that make sure the user has a shape from 3 - 1... | 33.046875 | 119 | 0.622695 |
d5fc34c2eaecbbd41c6ba0478c91bc1b9da5d24b | 13,307 | py | Python | qxpacker/Container.py | TODOTomorrow/qxpacker | cb59f606b85f213f9bd7e98ac5e4012c712cb010 | [
"MIT"
] | null | null | null | qxpacker/Container.py | TODOTomorrow/qxpacker | cb59f606b85f213f9bd7e98ac5e4012c712cb010 | [
"MIT"
] | null | null | null | qxpacker/Container.py | TODOTomorrow/qxpacker | cb59f606b85f213f9bd7e98ac5e4012c712cb010 | [
"MIT"
] | null | null | null | import types
import os
from qxpacker.shellgen import ShellScriptBuilder
from stat import ST_MODE
def enum(**enums):
return type('Enum', (), enums)
def path2prefixlist(path):
dirs = path.split('/')
ar = []
cs = ""
for dir in dirs:
cs += dir + "/"
ar.append(cs)
return ar[:-1]
de... | 33.774112 | 138 | 0.550763 |
005c81c23986b7a7313f832dcdcc3a8f52977c26 | 1,705 | py | Python | google-cloud-sdk/lib/googlecloudsdk/command_lib/components/util.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/lib/googlecloudsdk/command_lib/components/util.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/googlecloudsdk/command_lib/components/util.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.795918 | 79 | 0.780645 |
0683fa75b2ebc27d9131b03bc0dbce2319861964 | 626 | py | Python | hgapp/characters/migrations/0030_auto_20210415_1930.py | shadytradesman/The-Contract-Website | d8b353064f91c53ebab951dec784a0a36caba260 | [
"Apache-2.0"
] | 6 | 2020-10-03T12:15:05.000Z | 2021-10-15T04:43:36.000Z | hgapp/characters/migrations/0030_auto_20210415_1930.py | shadytradesman/The-Contract-Website | d8b353064f91c53ebab951dec784a0a36caba260 | [
"Apache-2.0"
] | 99 | 2020-06-04T17:43:56.000Z | 2022-03-12T01:07:20.000Z | hgapp/characters/migrations/0030_auto_20210415_1930.py | shadytradesman/The-Contract-Website | d8b353064f91c53ebab951dec784a0a36caba260 | [
"Apache-2.0"
] | 9 | 2020-06-06T16:39:09.000Z | 2020-10-02T16:24:17.000Z | # Generated by Django 2.2.13 on 2021-04-15 19:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('characters', '0029_auto_20210415_1927'),
]
operations = [
migrations.AlterField(
model_name='roll',
name='speed',
... | 32.947368 | 289 | 0.623003 |
94e296be7bc4d64199266113ed58dc4849c79011 | 683 | py | Python | ucsmsdk/methodmeta/EventUnRegisterEventChannelMeta.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/methodmeta/EventUnRegisterEventChannelMeta.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/methodmeta/EventUnRegisterEventChannelMeta.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | """This module contains the meta information of EventUnRegisterEventChannel ExternalMethod."""
import sys, os
from ..ucscoremeta import MethodMeta, MethodPropertyMeta
method_meta = MethodMeta("EventUnRegisterEventChannel", "eventUnRegisterEventChannel", "Version142b")
prop_meta = {
"cookie": MethodPropertyMeta("... | 34.15 | 107 | 0.710102 |
765c6bbc55d698b918a389c739486118674672ee | 6,397 | py | Python | code/src/main/python/analysis/parsers/arg_parser.py | DynamicCodeSearch/CodeSeer | ee985ece7691691585952eb88565f0e08bdc9113 | [
"MIT"
] | 5 | 2020-04-05T18:04:13.000Z | 2021-04-13T20:34:19.000Z | code/src/main/python/analysis/parsers/arg_parser.py | DynamicCodeSearch/CodeSeer | ee985ece7691691585952eb88565f0e08bdc9113 | [
"MIT"
] | 1 | 2020-04-29T21:42:26.000Z | 2020-05-01T23:45:45.000Z | code/src/main/python/analysis/parsers/arg_parser.py | DynamicCodeSearch/CodeSeer | ee985ece7691691585952eb88565f0e08bdc9113 | [
"MIT"
] | 3 | 2020-01-27T16:02:14.000Z | 2021-02-08T13:25:15.000Z | import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
import ast
from analysis.helpers import constants as a_consts
from analysis.blocks import position as position_block
from analysis.blocks import scope as scope_block
from analysis.blocks import types ... | 35.938202 | 117 | 0.702829 |
8fa9a450098308e2863c8c5e7b59fda4c53504a8 | 4,134 | py | Python | pycspr/serialisation/cl_value_to_parsed.py | casper-network/pycspr | 24244a82396db164beec23a461d13adab98aba0e | [
"Apache-2.0"
] | 11 | 2021-09-27T08:41:18.000Z | 2022-03-24T11:25:20.000Z | pycspr/serialisation/cl_value_to_parsed.py | casper-network/pycspr | 24244a82396db164beec23a461d13adab98aba0e | [
"Apache-2.0"
] | 13 | 2021-09-13T19:08:45.000Z | 2022-02-08T10:01:12.000Z | pycspr/serialisation/cl_value_to_parsed.py | casper-network/pycspr | 24244a82396db164beec23a461d13adab98aba0e | [
"Apache-2.0"
] | 14 | 2021-07-12T10:46:33.000Z | 2022-03-01T08:25:07.000Z | from pycspr.crypto import cl_checksum
from pycspr.types import cl_values
def encode(entity: cl_values.CL_Value) -> object:
"""Encodes a CL value as value interpretable by humans.
:param entity: A CL value to be encoded.
:returns: A humanized CL value representation.
"""
try:
encoder = _E... | 25.8375 | 87 | 0.704644 |
74071d7a39bcddc3454b73cf700b57add0ae0691 | 556 | py | Python | test/pyaz/cosmosdb/sql/restorable_database/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/cosmosdb/sql/restorable_database/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/cosmosdb/sql/restorable_database/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from .... pyaz_utils import get_cli_name, get_params
def list(location, instance_id):
params = get_params(locals())
command = "az cosmosdb sql restorable-database list " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subpr... | 30.888889 | 96 | 0.676259 |
9c3f650be99979df2b763c3e9bedb99d0945908e | 844 | py | Python | Hidden messages/PatternToNumber(recursive).py | lovroselic/Coursera | 1598b4fe02eb3addbc847f4f3ec21fb5b6e0be08 | [
"MIT"
] | null | null | null | Hidden messages/PatternToNumber(recursive).py | lovroselic/Coursera | 1598b4fe02eb3addbc847f4f3ec21fb5b6e0be08 | [
"MIT"
] | null | null | null | Hidden messages/PatternToNumber(recursive).py | lovroselic/Coursera | 1598b4fe02eb3addbc847f4f3ec21fb5b6e0be08 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 15:06:00 2020
@author: SELICLO1
"""
def NumberToPattern(x, K):
MAP = ['A', 'C', 'G', 'T']
pat = []
while K > 0:
R = x % 4
x = x // 4
pat.insert(0, MAP[R])
K -= 1
return "".join(pat)
def SymbolToNumber(c):
if c ==... | 18.755556 | 61 | 0.574645 |
051c80398614d5016009ee853103ffa6c42a7174 | 4,747 | py | Python | symopt/variable.py | spcornelius/symopt | 6f276ca07cc266af1cd58758a0cf413ab85f2591 | [
"MIT"
] | null | null | null | symopt/variable.py | spcornelius/symopt | 6f276ca07cc266af1cd58758a0cf413ab85f2591 | [
"MIT"
] | null | null | null | symopt/variable.py | spcornelius/symopt | 6f276ca07cc266af1cd58758a0cf413ab85f2591 | [
"MIT"
] | null | null | null | import numpy as np
import sympy as sym
from sympy import oo, sympify
import symopt.util as util
from symopt.base import SymOptSymbol
__all__ = []
__all__.extend([
'Variable'
])
class Variable(SymOptSymbol):
""" Symbolic variable in an `.OptimizationProblem`.
Wraps a `~sympy.core.symbols.Symbol` or
... | 33.666667 | 79 | 0.567727 |
95b91db50db9f1960e63bda72da7dd0b20798e28 | 1,781 | py | Python | vest/preprocess/embedding.py | vcerqueira/vest-python | 146e1ee50463637c89e32112283cf857e2eb190a | [
"MIT"
] | 5 | 2021-04-26T12:55:05.000Z | 2021-12-23T20:03:57.000Z | vest/preprocess/embedding.py | vcerqueira/vest-python | 146e1ee50463637c89e32112283cf857e2eb190a | [
"MIT"
] | null | null | null | vest/preprocess/embedding.py | vcerqueira/vest-python | 146e1ee50463637c89e32112283cf857e2eb190a | [
"MIT"
] | 3 | 2021-02-12T23:12:22.000Z | 2021-06-11T14:25:58.000Z | import numpy as np
import pandas as pd
def embed(sequence, k: int, return_df: bool = False):
""" Time Delay Embedding without X-y partition
:param return_df: Boolean, whether or not to return series as pd.DataFrame
:param sequence: A 1-d numeric time series
:param k: Embedding dimension
:return: ... | 24.067568 | 78 | 0.592925 |
7abdd773ff27943f44e463cb282d1e90a4af4fc8 | 9,456 | py | Python | bzt/modules/apiritif/executor.py | pck-tz/taurus | 4a9ec509580ea04dd65988206e84a0c1c06f7b79 | [
"Apache-2.0"
] | null | null | null | bzt/modules/apiritif/executor.py | pck-tz/taurus | 4a9ec509580ea04dd65988206e84a0c1c06f7b79 | [
"Apache-2.0"
] | null | null | null | bzt/modules/apiritif/executor.py | pck-tz/taurus | 4a9ec509580ea04dd65988206e84a0c1c06f7b79 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 BlazeMeter 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, software... | 37.375494 | 120 | 0.62151 |
5740dcb6d309d49f635c357cb8013def0fedf4e6 | 20,269 | py | Python | celery/result.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | 1 | 2015-12-02T17:12:09.000Z | 2015-12-02T17:12:09.000Z | celery/result.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | celery/result.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
celery.result
~~~~~~~~~~~~~
Task results/state and groups of results.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from __future__ import with_statement
import time
from collections ... | 29.206052 | 79 | 0.589669 |
a46b4010fac42edb492a648acacd7f847bc41385 | 5,296 | py | Python | aydin/util/j_invariance/util.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 78 | 2021-11-08T16:11:23.000Z | 2022-03-27T17:51:04.000Z | aydin/util/j_invariance/util.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 19 | 2021-11-08T17:15:40.000Z | 2022-03-30T17:46:55.000Z | aydin/util/j_invariance/util.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 7 | 2021-11-09T17:42:32.000Z | 2022-03-09T00:37:57.000Z | import itertools
import traceback
from functools import lru_cache, reduce
from typing import Optional, List, Tuple
import numpy
from numpy import zeros_like, zeros
from numpy.typing import ArrayLike
from scipy.ndimage import convolve, gaussian_filter, median_filter
from aydin.analysis.blind_spot_analysis import auto_... | 29.098901 | 88 | 0.660876 |
cae1c8eb0b2e97a751bbc042d8e5bea8db93f526 | 2,004 | py | Python | spyder/app/tests/test_cli_options.py | mirazakon/spyder | c322d46af16a30aba089788a59a4e7db00ffb83f | [
"MIT"
] | 3 | 2019-09-27T21:00:00.000Z | 2021-03-07T23:28:32.000Z | spyder/app/tests/test_cli_options.py | mirazakon/spyder | c322d46af16a30aba089788a59a4e7db00ffb83f | [
"MIT"
] | 3 | 2020-10-13T21:15:23.000Z | 2020-10-13T21:15:24.000Z | spyder/app/tests/test_cli_options.py | mirazakon/spyder | c322d46af16a30aba089788a59a4e7db00ffb83f | [
"MIT"
] | 2 | 2021-04-30T01:18:22.000Z | 2021-09-19T06:31:42.000Z | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""
Tests for cli_options.py
"""
import pytest
from spyder.app import cli_options
@pytest.mark.first
def test_get_options():
getopt = cli_options.get_options
options, args = getopt([])
ass... | 28.225352 | 79 | 0.689621 |
f75fb3fb0f42aff15d42f5b242baceeb30ddb552 | 233 | py | Python | app/main.py | SuperOrca/Notes | 2c4906447c86f29bc2d8b068c5e7f83e1f09ccde | [
"MIT"
] | null | null | null | app/main.py | SuperOrca/Notes | 2c4906447c86f29bc2d8b068c5e7f83e1f09ccde | [
"MIT"
] | null | null | null | app/main.py | SuperOrca/Notes | 2c4906447c86f29bc2d8b068c5e7f83e1f09ccde | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template
main = Blueprint("main", __name__)
@main.route("/")
def index():
return render_template("index.html")
@main.route("/about")
def about():
return render_template("about.html")
| 15.533333 | 44 | 0.699571 |
f9b0d85eb5332f93af483972231f3dde8f777235 | 11,348 | py | Python | src/benchmarks/gc/src/analysis/condemned_reasons.py | sandreenko/performance | 11b77ba778e8d952caee4c407c90e7c4eabfb5bc | [
"MIT"
] | 1 | 2022-02-10T10:10:49.000Z | 2022-02-10T10:10:49.000Z | src/benchmarks/gc/src/analysis/condemned_reasons.py | sandreenko/performance | 11b77ba778e8d952caee4c407c90e7c4eabfb5bc | [
"MIT"
] | null | null | null | src/benchmarks/gc/src/analysis/condemned_reasons.py | sandreenko/performance | 11b77ba778e8d952caee4c407c90e7c4eabfb5bc | [
"MIT"
] | null | null | null | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import FrozenSet, Mapping,... | 32.330484 | 100 | 0.723916 |
e33be11dc62b9c36dbf2214f9dd352fe394975b7 | 1,639 | py | Python | setup.py | edalrami/myCoin | b4b3a65d9ee006d77fa837f0d9cb94af0b56ce58 | [
"MIT"
] | null | null | null | setup.py | edalrami/myCoin | b4b3a65d9ee006d77fa837f0d9cb94af0b56ce58 | [
"MIT"
] | null | null | null | setup.py | edalrami/myCoin | b4b3a65d9ee006d77fa837f0d9cb94af0b56ce58 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name = 'myCoin', # How you named your package folder (MyLib)
packages = ['myCoin'], # Chose the same as "name"
version = '0.3.1', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: https... | 60.703704 | 146 | 0.654667 |
5e6af574458fc28ce337c3b6a74deb91c53e3b90 | 688 | py | Python | verify/search.py | Vibhuti1402agg/vonage-python-code-snippets | a437dc4fd89548143029bc5569559ccd5d822cd9 | [
"MIT"
] | 1 | 2021-07-30T00:39:34.000Z | 2021-07-30T00:39:34.000Z | verify/search.py | Vibhuti1402agg/vonage-python-code-snippets | a437dc4fd89548143029bc5569559ccd5d822cd9 | [
"MIT"
] | null | null | null | verify/search.py | Vibhuti1402agg/vonage-python-code-snippets | a437dc4fd89548143029bc5569559ccd5d822cd9 | [
"MIT"
] | null | null | null | import argparse
import os
from os.path import join, dirname
from dotenv import load_dotenv
dotenv_path = join(dirname(__file__), "../.env")
load_dotenv(dotenv_path)
VONAGE_API_KEY = os.getenv("VONAGE_API_KEY")
VONAGE_API_SECRET = os.getenv("VONAGE_API_SECRET")
argument_parser = argparse.ArgumentParser()
argument_par... | 23.724138 | 60 | 0.771802 |
96cf91ec01f4fc324a65ce00e3440ddae03a723a | 1,182 | py | Python | src/scene/grass.py | vlad94568/bricks | ffe6b761930fcb592c802cd7fde4b0657b05f951 | [
"Apache-2.0"
] | 2 | 2018-12-13T04:10:51.000Z | 2019-11-23T10:24:59.000Z | src/scene/grass.py | vlad94568/bricks | ffe6b761930fcb592c802cd7fde4b0657b05f951 | [
"Apache-2.0"
] | null | null | null | src/scene/grass.py | vlad94568/bricks | ffe6b761930fcb592c802cd7fde4b0657b05f951 | [
"Apache-2.0"
] | null | null | null | #
# _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/ _/ _/_/_/
# _/ _/ _/ _/ _/ _/ _/ _/ _/
# _/_/_/ _/_/_/ _/ _/ _/_/ _/_/
# _/ _/ _/ _/ _/ _/ _/ _/ _/
# _/_/_/ _/ _/ _/_/_/ _/_/_/ _/ _/ _/_/_/
#
# By Vlad Ivano... | 31.105263 | 92 | 0.538071 |
d14abe08155e81fee7a79425fbead3beb183e38b | 5,375 | py | Python | rest_framework_simplejwt/serializers.py | Eriz1818/django-rest-framework-simplejwt | 8678f96a3eac139c4b4d8160ec2e7e5769cc1e60 | [
"MIT"
] | null | null | null | rest_framework_simplejwt/serializers.py | Eriz1818/django-rest-framework-simplejwt | 8678f96a3eac139c4b4d8160ec2e7e5769cc1e60 | [
"MIT"
] | null | null | null | rest_framework_simplejwt/serializers.py | Eriz1818/django-rest-framework-simplejwt | 8678f96a3eac139c4b4d8160ec2e7e5769cc1e60 | [
"MIT"
] | null | null | null | ##### MODDED #####
from __future__ import unicode_literals
from django.contrib.auth import authenticate
from django.utils.six import text_type
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from .settings import api_settings
from .state import User
from .tokens import R... | 31.432749 | 132 | 0.666047 |
86a201543089b3e603534ed1f5fd64e44dff11d2 | 2,173 | py | Python | thonny/languages.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | 1 | 2022-02-09T06:25:31.000Z | 2022-02-09T06:25:31.000Z | thonny/languages.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | null | null | null | thonny/languages.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | null | null | null | import gettext
from logging import getLogger
import os
logger = getLogger(__name__)
BASE_LANGUAGE_CODE = "en_US"
BASE_LANGUAGE_NAME = "English"
# https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
LANGUAGES_DICT = {
"cs_CZ": "Čeština [BETA]",
"de_DE": "Deutsch",
"et_EE": "Eesti",
BASE_LANGUAGE_C... | 26.180723 | 84 | 0.628624 |
1f209b72dea5a625553e2f61b4607dde78105350 | 2,296 | py | Python | pose/dataset_factory.py | lugimzheng/demo | 5fc22810da2c4c61c0d45ffb0bbdf965901b12b9 | [
"MIT"
] | null | null | null | pose/dataset_factory.py | lugimzheng/demo | 5fc22810da2c4c61c0d45ffb0bbdf965901b12b9 | [
"MIT"
] | null | null | null | pose/dataset_factory.py | lugimzheng/demo | 5fc22810da2c4c61c0d45ffb0bbdf965901b12b9 | [
"MIT"
] | null | null | null | '''
File: dataset_factory.py
Project: MobilePose-PyTorch
File Created: Sunday, 10th March 2019 8:02:12 pm
Author: Yuliang Xiu (yuliangxiu@sjtu.edu.cn)
-----
Last Modified: Monday, 11th March 2019 12:51:11 am
Modified By: Yuliang Xiu (yuliangxiu@sjtu.edu.cn>)
-----
Copyright 2018 - 2019 Shanghai Jiao Tong University, Ma... | 30.613333 | 90 | 0.600174 |
334f49274e7a85bda654f4e75018a8a9f1be6d62 | 1,288 | py | Python | tests/extension/seq_/hook_nested/test_seq_hook_nested.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | tests/extension/seq_/hook_nested/test_seq_hook_nested.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | tests/extension/seq_/hook_nested/test_seq_hook_nested.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import seq_hook_nested
expected_verilog = """
module top #
(
parameter WIDTH = 8
)
(
input CLK,
input RST,
output [WIDTH-1:0] LED
);
blinkled
#(
.WIDTH(WIDTH)
)
inst_blinkled
(
.CLK(CLK),
.RS... | 17.405405 | 69 | 0.629658 |
4aa86cf501d33d0cd3b0af617fcba4bb95fb3fd4 | 12,457 | py | Python | venv/Lib/site-packages/networkx/algorithms/components/biconnected.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 10,024 | 2015-01-01T13:06:43.000Z | 2022-03-31T12:45:25.000Z | venv/Lib/site-packages/networkx/algorithms/components/biconnected.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 3,191 | 2015-01-01T18:13:11.000Z | 2022-03-31T22:06:00.000Z | venv/Lib/site-packages/networkx/algorithms/components/biconnected.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 3,272 | 2015-01-01T05:04:53.000Z | 2022-03-31T17:46:35.000Z | """Biconnected components and articulation points."""
from itertools import chain
from networkx.utils.decorators import not_implemented_for
__all__ = [
"biconnected_components",
"biconnected_component_edges",
"is_biconnected",
"articulation_points",
]
@not_implemented_for("directed")
def is_biconnect... | 33.04244 | 85 | 0.640925 |
8939497ab6a5a64a9dacdbe87fa7c09fbc11acda | 9,966 | py | Python | test/python/WMCore_t/WebTools_t/Root_t.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | null | null | null | test/python/WMCore_t/WebTools_t/Root_t.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | null | null | null | test/python/WMCore_t/WebTools_t/Root_t.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from future import standard_library
standard_library.install_aliases()
import unittest
import logging
import urllib.request
from WMCore.WebTools.Root import Root
from WMCore.Configuration import Configuration
from cherrypy import engine, tree
from cherrypy import config as cpconfig
from tempfile... | 37.75 | 102 | 0.649207 |
7197c086dbb283521f5ec86e5b6d8d56348015b8 | 4,063 | py | Python | code/path.py | suyash622/Smart_cleaning_robot | 658a12912323049c10f01f3a9438a610336a167c | [
"MIT"
] | 1 | 2018-04-17T02:01:17.000Z | 2018-04-17T02:01:17.000Z | code/path.py | suyash622/Smart_cleaning_robot | 658a12912323049c10f01f3a9438a610336a167c | [
"MIT"
] | null | null | null | code/path.py | suyash622/Smart_cleaning_robot | 658a12912323049c10f01f3a9438a610336a167c | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import networkx as nx
import sys
class gen_path(object):
def __init__(node_data,edge_data,special_edges):
self.node_data=node_data
self.edge_data=edge_data
self.special_nodes=special_edges
self.path=[]
self.origin = origin
self.target =target
self... | 22.447514 | 77 | 0.598819 |
c6e7acf059f8ee75e116d600221ac0f1a9cbf900 | 2,202 | py | Python | sort/heap.py | clifflu/alg-playground | 996d8e50d98988ef09b5da5f9133afaa9905e944 | [
"MIT"
] | null | null | null | sort/heap.py | clifflu/alg-playground | 996d8e50d98988ef09b5da5f9133afaa9905e944 | [
"MIT"
] | null | null | null | sort/heap.py | clifflu/alg-playground | 996d8e50d98988ef09b5da5f9133afaa9905e944 | [
"MIT"
] | null | null | null | """
max heap
"""
def parentIdx(idx):
"""
>>> parentIdx(1)
0
>>> parentIdx(2)
0
>>> parentIdx(3)
1
>>> parentIdx(4)
1
"""
return (idx - 1) // 2
def childIdx(idx):
"""
>>> childIdx(0)
(1, 2)
>>> childIdx(1)
(3, 4)
>>> childIdx(2)
(5, 6)
"""
... | 18.35 | 64 | 0.424614 |
0455ae3dfebaeb8e16acc311fb52df447f7c29d3 | 7,565 | py | Python | platforms/ios/build_framework.py | andreasBihlmaier/opencv | 6f0e9af5fe940a9d9a459b6267623db5a1e9db74 | [
"BSD-3-Clause"
] | 1 | 2021-06-05T01:58:10.000Z | 2021-06-05T01:58:10.000Z | platforms/ios/build_framework.py | andreasBihlmaier/opencv | 6f0e9af5fe940a9d9a459b6267623db5a1e9db74 | [
"BSD-3-Clause"
] | null | null | null | platforms/ios/build_framework.py | andreasBihlmaier/opencv | 6f0e9af5fe940a9d9a459b6267623db5a1e9db74 | [
"BSD-3-Clause"
] | 4 | 2019-04-19T05:01:08.000Z | 2020-01-23T05:37:15.000Z | #!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir sh... | 39.815789 | 159 | 0.593523 |
2d845c57f1b23504b6b2f384b9bc9019e0f5b286 | 4,270 | py | Python | bioprov/tests/test_bioprov_programs.py | vinisalazar/BioProv | 8d93ff10e963cceb33bc6a87f3aaf645879320da | [
"MIT"
] | 13 | 2020-09-30T14:32:29.000Z | 2021-12-14T08:36:37.000Z | bioprov/tests/test_bioprov_programs.py | vinisalazar/BioProv | 8d93ff10e963cceb33bc6a87f3aaf645879320da | [
"MIT"
] | 20 | 2020-10-16T15:41:28.000Z | 2021-10-05T17:03:53.000Z | bioprov/tests/test_bioprov_programs.py | vinisalazar/BioProv | 8d93ff10e963cceb33bc6a87f3aaf645879320da | [
"MIT"
] | 1 | 2020-10-16T17:10:18.000Z | 2020-10-16T17:10:18.000Z | __author__ = "Vini Salazar"
__license__ = "MIT"
__maintainer__ = "Vini Salazar"
__url__ = "https://github.com/vinisalazar/bioprov"
__version__ = "0.1.24"
__doc__ = """
Testing for the programs package.
"""
from bioprov import Sample
from bioprov.data import synechococcus_genome
from bioprov.programs import (
blas... | 23.081081 | 85 | 0.627635 |
864e197cd5365230c69917a93fecd14e4e2c0d20 | 21,619 | py | Python | Test/spec/simd/meta/simd_bitwise.py | vavrusa/WAVM | 7b96fb2c39d6214011ac3922c314b9bfc25d73f7 | [
"BSD-3-Clause"
] | null | null | null | Test/spec/simd/meta/simd_bitwise.py | vavrusa/WAVM | 7b96fb2c39d6214011ac3922c314b9bfc25d73f7 | [
"BSD-3-Clause"
] | null | null | null | Test/spec/simd/meta/simd_bitwise.py | vavrusa/WAVM | 7b96fb2c39d6214011ac3922c314b9bfc25d73f7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
This file is used for generating bitwise test cases
"""
from simd import SIMD
from test_assert import AssertReturn
class SimdBitWise(SIMD):
"""
Generate common tests
"""
# Test case template
CASE_TXT = """;; Test all the bitwise operators on major boundary values and ... | 49.928406 | 125 | 0.407743 |
b30e9aecf6f3ca07079e2b09c1b9f48b2a9110cf | 337 | py | Python | threads/time.py | unkSonert/Vk-Bot-Uni-Dubna | e229a0200d2033693442fa22d02dcedd171e5510 | [
"MIT"
] | null | null | null | threads/time.py | unkSonert/Vk-Bot-Uni-Dubna | e229a0200d2033693442fa22d02dcedd171e5510 | [
"MIT"
] | null | null | null | threads/time.py | unkSonert/Vk-Bot-Uni-Dubna | e229a0200d2033693442fa22d02dcedd171e5510 | [
"MIT"
] | 2 | 2019-03-20T19:04:20.000Z | 2019-03-20T21:32:19.000Z | from datetime import datetime, timedelta
from time import sleep
def sleep_to_hour(hour):
now = datetime.today()
if now.hour >= hour:
future = datetime(now.year, now.month, now.day, hour) + timedelta(days=1)
else:
future = datetime(now.year, now.month, now.day, hour)
sleep((future - no... | 25.923077 | 81 | 0.658754 |
d294a1621c92c927487122f25523351f39091b8c | 887 | py | Python | xml/SaveXml.py | K-State-Computational-Core/serialization-examples-python | b147602a2b84d87019519138e37328b0a0f4f53b | [
"MIT"
] | null | null | null | xml/SaveXml.py | K-State-Computational-Core/serialization-examples-python | b147602a2b84d87019519138e37328b0a0f4f53b | [
"MIT"
] | null | null | null | xml/SaveXml.py | K-State-Computational-Core/serialization-examples-python | b147602a2b84d87019519138e37328b0a0f4f53b | [
"MIT"
] | null | null | null | from Person import Person
from Pet import Pet
import xml.etree.ElementTree as ET
import sys
class SaveXml:
@staticmethod
def main(args):
person = Person("Willie Wildcat", 42, Pet("Reggie", 4, "Shorkie"))
print("Saving person:")
print(person)
person_elem = ET.Eleme... | 30.586207 | 74 | 0.627959 |
71686f98dc7a6b0acc96959b2114675ed8e07083 | 1,720 | py | Python | src/main/resources/servicenow/GetChangeRequest.py | ctlliny/xebialabs-communityb | 62d93bb514a95d6682c14ebe08fb30147e3e2f62 | [
"MIT"
] | 7 | 2017-02-07T16:11:14.000Z | 2019-02-24T15:09:13.000Z | src/main/resources/servicenow/GetChangeRequest.py | ctlliny/xebialabs-communityb | 62d93bb514a95d6682c14ebe08fb30147e3e2f62 | [
"MIT"
] | 12 | 2016-01-12T21:43:10.000Z | 2018-08-01T02:54:37.000Z | src/main/resources/servicenow/GetChangeRequest.py | ctlliny/xebialabs-communityb | 62d93bb514a95d6682c14ebe08fb30147e3e2f62 | [
"MIT"
] | 17 | 2015-11-17T09:28:08.000Z | 2021-05-15T08:07:03.000Z | #
# Copyright 2019 XEBIALABS
#
# 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, distribute, subli... | 46.486486 | 462 | 0.787209 |
30b4fc1097e154756184b92dbb738dd70e283993 | 14,855 | py | Python | lib/galaxy/web/framework/decorators.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/web/framework/decorators.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/web/framework/decorators.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | null | null | null | import inspect
from traceback import format_exc
from functools import wraps
from galaxy import eggs
eggs.require( "Paste" )
import paste.httpexceptions
from galaxy.web.framework import url_for
from galaxy import util
from galaxy.exceptions import error_codes
from galaxy.exceptions import MessageException
from galaxy.... | 44.080119 | 148 | 0.635005 |
8c36451dcf81cf1a05f2b72cd843c1b6c63c4e84 | 15,925 | py | Python | pcdet/datasets/zenseact/zenseact_dataset.py | zenseact/OpenPCDet | d0306293a11ae7402ac44873d2c2515325e57551 | [
"Apache-2.0"
] | null | null | null | pcdet/datasets/zenseact/zenseact_dataset.py | zenseact/OpenPCDet | d0306293a11ae7402ac44873d2c2515325e57551 | [
"Apache-2.0"
] | null | null | null | pcdet/datasets/zenseact/zenseact_dataset.py | zenseact/OpenPCDet | d0306293a11ae7402ac44873d2c2515325e57551 | [
"Apache-2.0"
] | 2 | 2022-01-26T12:48:54.000Z | 2022-01-26T22:29:11.000Z | import copy
import json
import os
import numpy as np
import yaml
from torch.utils import data
from tqdm import tqdm
from ...utils import box_utils, common_utils
from ...utils.object3d_kitti import Object3d
from ..dataset import DatasetTemplate
def _object_has_3d_prop(obj: Object3d):
return not (
obj.h =... | 37.295082 | 132 | 0.521381 |
1ff57061ac910fa0f0192858d31ff6705d083787 | 546 | py | Python | hands_on_machine_learning_with_scikit_learn_&_tensorflow/8_dimensionality_reduction/exercises/10.py | HuangStomach/machine-learning | 47689469c431e2a833437b38832d3fdceda7b2b2 | [
"MIT"
] | null | null | null | hands_on_machine_learning_with_scikit_learn_&_tensorflow/8_dimensionality_reduction/exercises/10.py | HuangStomach/machine-learning | 47689469c431e2a833437b38832d3fdceda7b2b2 | [
"MIT"
] | null | null | null | hands_on_machine_learning_with_scikit_learn_&_tensorflow/8_dimensionality_reduction/exercises/10.py | HuangStomach/machine-learning | 47689469c431e2a833437b38832d3fdceda7b2b2 | [
"MIT"
] | null | null | null | from sklearn.manifold import TSNE
from sklearn.datasets import fetch_openml
import matplotlib.pyplot as plt
import numpy as np
mnist = fetch_openml('mnist_784', version=1, as_frame=False)
mnist.target = mnist.target.astype(np.uint8)
m = 10000
idx = np.random.permutation(60000)[:m]
X = mnist['data'][idx]
y = mnist['ta... | 24.818182 | 62 | 0.734432 |
3e1110218cb4e65f5c026e377589a317544caddd | 3,575 | py | Python | experiments/explorations/experiments/experiment_000102/repetition_000007/experiment_config.py | flowersteam/automated_discovery_of_lenia_patterns | 97cc7cde2120fa95225d1e470e00b8aa8c034e97 | [
"MIT"
] | 10 | 2019-10-05T16:22:11.000Z | 2021-12-30T14:09:42.000Z | experiments/explorations/experiments/experiment_000102/repetition_000007/experiment_config.py | flowersteam/automated_discovery_of_lenia_patterns | 97cc7cde2120fa95225d1e470e00b8aa8c034e97 | [
"MIT"
] | null | null | null | experiments/explorations/experiments/experiment_000102/repetition_000007/experiment_config.py | flowersteam/automated_discovery_of_lenia_patterns | 97cc7cde2120fa95225d1e470e00b8aa8c034e97 | [
"MIT"
] | 2 | 2019-10-14T12:12:38.000Z | 2020-09-16T11:18:26.000Z | import autodisc as ad
def get_system_parameters():
system_parameters = ad.systems.Lenia.default_system_parameters()
system_parameters.size_y = 256
system_parameters.size_x = 256
return system_parameters
def get_explorer_config():
explorer_config = ad.explorers.GoalSpaceExplorer.default_config(... | 38.031915 | 146 | 0.711329 |
625476aedcea9930b6b203841a5cf8a027483aa1 | 3,072 | py | Python | affiliate/worker/avazu.py | AdBund/Affiliate-Network | c6c3efc9d4268aed698deae8450616301a84c3e0 | [
"BSD-2-Clause"
] | null | null | null | affiliate/worker/avazu.py | AdBund/Affiliate-Network | c6c3efc9d4268aed698deae8450616301a84c3e0 | [
"BSD-2-Clause"
] | null | null | null | affiliate/worker/avazu.py | AdBund/Affiliate-Network | c6c3efc9d4268aed698deae8450616301a84c3e0 | [
"BSD-2-Clause"
] | 1 | 2020-11-13T18:15:53.000Z | 2020-11-13T18:15:53.000Z | import datetime
import logging
import peewee
from ..model import AProvider, AApiToken, AAffiliates, AStatistics, db
from ..rest import Avazu
def avazu():
"""
yeahmobi api with python
:return:
"""
provider = AProvider.get(name="avazu")
api_tokens = (AApiToken.select(AApiToken).join(AProvider... | 31.670103 | 117 | 0.491862 |
79226162392f93f713051c96de5f235367253862 | 269 | py | Python | tests/artificial/transf_None/trend_MovingMedian/cycle_30/ar_/test_artificial_128_None_MovingMedian_30__100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/artificial/transf_None/trend_MovingMedian/cycle_30/ar_/test_artificial_128_None_MovingMedian_30__100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/artificial/transf_None/trend_MovingMedian/cycle_30/ar_/test_artificial_128_None_MovingMedian_30__100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 30, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 0); | 38.428571 | 164 | 0.732342 |
8a577e4c3918a0380099e5f12fc703caeb25a56f | 2,942 | py | Python | redash/schedule.py | pushpay/redash | ef56e4e9208dbb373ed40d4c0040409e9d46977f | [
"BSD-2-Clause"
] | 1 | 2019-11-19T06:10:22.000Z | 2019-11-19T06:10:22.000Z | redash/schedule.py | pushpay/redash | ef56e4e9208dbb373ed40d4c0040409e9d46977f | [
"BSD-2-Clause"
] | 3 | 2022-02-14T01:15:27.000Z | 2022-02-27T11:21:50.000Z | redash/schedule.py | pushpay/redash | ef56e4e9208dbb373ed40d4c0040409e9d46977f | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
import hashlib
import json
from datetime import datetime, timedelta
from functools import partial
from random import randint
from rq.job import Job
from rq_scheduler import Scheduler
from redash import settings, rq_redis_connection
from redash.tasks import (sync_u... | 34.611765 | 115 | 0.688647 |
e70341b8a0eb569aff82a28da451d214bc54b38a | 3,363 | py | Python | tests/matlab/nexmon/test_nexmon.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 67 | 2020-03-14T03:32:06.000Z | 2022-03-31T18:51:57.000Z | tests/matlab/nexmon/test_nexmon.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 25 | 2020-09-23T16:43:58.000Z | 2022-03-30T13:20:16.000Z | tests/matlab/nexmon/test_nexmon.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 18 | 2020-04-01T09:51:35.000Z | 2022-03-09T12:46:24.000Z | from CSIKit.reader import NEXBeamformReader
import numpy as np
import errno
import glob
import os
import scipy.io
class InconsistentOutputError(RuntimeError):
def __init__(self, arg):
self.args = arg
def test_nexmon_matlab_consistency():
example_dir = os.environ["NEX_TEST_EXAMPLE_DIR"]
mat_dir... | 38.655172 | 132 | 0.684508 |
848115a89b487924c81a2b6a07520615f288f0d1 | 2,087 | py | Python | dciqueue/add_resource_cmd.py | nsilla/dci-pipeline | 5395a715677b5e1c305967b2fd1ba4d699261c93 | [
"Apache-2.0"
] | null | null | null | dciqueue/add_resource_cmd.py | nsilla/dci-pipeline | 5395a715677b5e1c305967b2fd1ba4d699261c93 | [
"Apache-2.0"
] | null | null | null | dciqueue/add_resource_cmd.py | nsilla/dci-pipeline | 5395a715677b5e1c305967b2fd1ba4d699261c93 | [
"Apache-2.0"
] | 2 | 2021-09-20T10:48:55.000Z | 2022-02-28T19:47:55.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020-2021 Red Hat, 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 applicab... | 28.202703 | 83 | 0.654528 |
191e0b620f7841233e556f1bb4b028dacba6ce96 | 8,467 | py | Python | google/cloud/dialogflow_v2beta1/services/versions/transports/base.py | rogers140/python-dialogflow | d9ce91f8590947736560727624fbc0846601ce1c | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflow_v2beta1/services/versions/transports/base.py | rogers140/python-dialogflow | d9ce91f8590947736560727624fbc0846601ce1c | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflow_v2beta1/services/versions/transports/base.py | rogers140/python-dialogflow | d9ce91f8590947736560727624fbc0846601ce1c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.631111 | 103 | 0.663281 |
4df94ff6b476fd62cd5b0996366fb07d8786eb5d | 6,888 | py | Python | tools/hive-bigquery/bigquery_table_model.py | mrhungr-github/professional-services | 3163204b24815741e0d4cb6482ae9c4b0b2c2f3c | [
"Apache-2.0"
] | null | null | null | tools/hive-bigquery/bigquery_table_model.py | mrhungr-github/professional-services | 3163204b24815741e0d4cb6482ae9c4b0b2c2f3c | [
"Apache-2.0"
] | null | null | null | tools/hive-bigquery/bigquery_table_model.py | mrhungr-github/professional-services | 3163204b24815741e0d4cb6482ae9c4b0b2c2f3c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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, ... | 34.964467 | 84 | 0.579704 |
1cf4a1ef8155b8261a2c30269f8c74d4d6756ff1 | 5,898 | py | Python | chia/plotter/plotter.py | duolacloud/chia-blockchain | 4f3f41bd1e21a4f7b0ac540a571531fb2a2b7e2b | [
"Apache-2.0"
] | null | null | null | chia/plotter/plotter.py | duolacloud/chia-blockchain | 4f3f41bd1e21a4f7b0ac540a571531fb2a2b7e2b | [
"Apache-2.0"
] | null | null | null | chia/plotter/plotter.py | duolacloud/chia-blockchain | 4f3f41bd1e21a4f7b0ac540a571531fb2a2b7e2b | [
"Apache-2.0"
] | null | null | null | import click
from chia import __version__
from chia.util.default_root import DEFAULT_ROOT_PATH
from pathlib import Path
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
DEFAULT_STRIPE_SIZE = 65536
def monkey_patch_click() -> None:
# this hacks around what seems to be an incompatibility between the p... | 35.317365 | 120 | 0.678026 |
f051e2182fff2ff2d9cd1a21d5fe3ce448662353 | 6,699 | py | Python | tests/test_backend/test_definitions.py | MartinHowarth/est8 | fcc5700024830eada2d08b409fdefb9a0edca4a2 | [
"MIT"
] | null | null | null | tests/test_backend/test_definitions.py | MartinHowarth/est8 | fcc5700024830eada2d08b409fdefb9a0edca4a2 | [
"MIT"
] | 1 | 2020-01-11T14:50:48.000Z | 2020-01-11T14:50:48.000Z | tests/test_backend/test_definitions.py | MartinHowarth/est8 | fcc5700024830eada2d08b409fdefb9a0edca4a2 | [
"MIT"
] | null | null | null | from est8.backend.definitions import (
NeighbourhoodDefinition,
DeckDefinition,
CardDefinition,
ScoringDefinition,
StreetDefinition,
GameDefinition,
InvestDefinition,
)
def test_street_definition(subtests):
defn = StreetDefinition(num_houses=2, pool_locations=(0,), park_scoring=(0, 2))... | 37.424581 | 93 | 0.659949 |
bfee8eabc67920c413b62ec4caa5d7cbf7d23ce9 | 5,748 | py | Python | fidimag/common/batch_task.py | computationalmodelling/fidimag | 07a275c897a44ad1e0d7e8ef563f10345fdc2a6e | [
"BSD-2-Clause"
] | 53 | 2016-02-27T09:40:21.000Z | 2022-01-19T21:37:44.000Z | fidimag/common/batch_task.py | computationalmodelling/fidimag | 07a275c897a44ad1e0d7e8ef563f10345fdc2a6e | [
"BSD-2-Clause"
] | 132 | 2016-02-26T13:18:58.000Z | 2021-12-01T21:52:42.000Z | fidimag/common/batch_task.py | computationalmodelling/fidimag | 07a275c897a44ad1e0d7e8ef563f10345fdc2a6e | [
"BSD-2-Clause"
] | 32 | 2016-02-26T13:21:40.000Z | 2022-03-08T08:54:51.000Z | from __future__ import print_function
import os
import time
import numpy as np
from multiprocessing import Process, Queue, Lock
lock = Lock()
class TaskState(object):
"""
Each task has three states: "Done!", "Started!", "Unstarted!"
"""
def __init__(self, taskname):
self.taskname = taskname
... | 25.891892 | 75 | 0.507133 |
050c827e78ab78e48eacb6a5d1cb070cd82bc8b8 | 1,933 | py | Python | tests/parsers/bencode_plugins/transmission.py | SamuelePilleri/plaso | f5687f12a89c7309797ccc285da78e855c120579 | [
"Apache-2.0"
] | null | null | null | tests/parsers/bencode_plugins/transmission.py | SamuelePilleri/plaso | f5687f12a89c7309797ccc285da78e855c120579 | [
"Apache-2.0"
] | null | null | null | tests/parsers/bencode_plugins/transmission.py | SamuelePilleri/plaso | f5687f12a89c7309797ccc285da78e855c120579 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the bencode parser plugin for Transmission BitTorrent files."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import bencode_parser as _ # pylint: disable=unused-import
from plaso.lib import definitions
from plaso.parsers imp... | 33.327586 | 81 | 0.755303 |
837ea93173ffeb79e97aa46669def1c3538e6578 | 2,551 | py | Python | neutron/objects/l3_hamode.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 1 | 2018-10-19T01:48:37.000Z | 2018-10-19T01:48:37.000Z | neutron/objects/l3_hamode.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | neutron/objects/l3_hamode.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright (c) 2016 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 30.73494 | 78 | 0.705998 |
fef6e4551a1ccffc5e44a45cb801dd4185413d25 | 7,978 | py | Python | birdvoxdetect/cli.py | Darrious/birdvoxdetect | b18b535ab9eb48ccfab6bc97e037df22645e80b8 | [
"MIT"
] | null | null | null | birdvoxdetect/cli.py | Darrious/birdvoxdetect | b18b535ab9eb48ccfab6bc97e037df22645e80b8 | [
"MIT"
] | null | null | null | birdvoxdetect/cli.py | Darrious/birdvoxdetect | b18b535ab9eb48ccfab6bc97e037df22645e80b8 | [
"MIT"
] | null | null | null | from __future__ import print_function
from argparse import ArgumentParser, RawDescriptionHelpFormatter, ArgumentTypeError
from collections import Iterable
import logging
import numpy as np
import os
from six import string_types
import sys
import birdvoxdetect
from birdvoxdetect.birdvoxdetect_exceptions import BirdVoxD... | 27.701389 | 87 | 0.600652 |
d1ea1fa61d04cb5f3163b05281cdb0ec4c0cb61a | 4,330 | py | Python | sdk/python/pulumi_gcp/sql/database.py | pulumi-bot/pulumi-gcp | 43ff11bf1c99b4e9e493f61d9755e359b686ae67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/sql/database.py | pulumi-bot/pulumi-gcp | 43ff11bf1c99b4e9e493f61d9755e359b686ae67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/sql/database.py | pulumi-bot/pulumi-gcp | 43ff11bf1c99b4e9e493f61d9755e359b686ae67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
class Database(pulumi.CustomResource):
"""
Creates a new Google SQL Database on a Google S... | 43.3 | 129 | 0.641109 |
e6292274e9c8950f09e00b99773a961216b25ce4 | 2,069 | py | Python | py/008_d1_compare_params.py | uclacores/dual_path_network | 3a73f4b3c461a5d17534737bfa9fdfedc5e48053 | [
"BSD-3-Clause"
] | 4 | 2021-11-29T14:43:20.000Z | 2022-02-21T12:32:28.000Z | py/008_d1_compare_params.py | uclacores/dual_path_network | 3a73f4b3c461a5d17534737bfa9fdfedc5e48053 | [
"BSD-3-Clause"
] | null | null | null | py/008_d1_compare_params.py | uclacores/dual_path_network | 3a73f4b3c461a5d17534737bfa9fdfedc5e48053 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import matplotlib.pyplot as plt
import numpy as np
import pickle
import os
import time
# In[2]:
from frm_dataset_loader import load_dataset
from conf_dataset_1 ... | 16.291339 | 121 | 0.711938 |
aa52ef8b9b2f0684e81a6268d2faf3ee9abdd891 | 6,073 | py | Python | gui/kivy/uix/dialogs/tx_dialog.py | UlordChain/uwallet-client-pro | 103a3f7cf4e566e87f366739774f688339aea398 | [
"MIT"
] | 22 | 2018-05-29T01:46:24.000Z | 2018-08-21T06:59:07.000Z | gui/kivy/uix/dialogs/tx_dialog.py | UlordChain/uwallet-client-pro | 103a3f7cf4e566e87f366739774f688339aea398 | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/tx_dialog.py | UlordChain/uwallet-client-pro | 103a3f7cf4e566e87f366739774f688339aea398 | [
"MIT"
] | 2 | 2018-09-15T21:59:44.000Z | 2019-02-16T02:46:15.000Z | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label
from uwallet_gui.kivy.i18n import _
from datetime import datetime
from uwallet.util import InvalidPassword
Builder.load_strin... | 34.117978 | 164 | 0.536638 |
ad5b465c01d8073359c51ea36e1e35b0ab716502 | 10,290 | py | Python | tests/test_pgexecute.py | isabella232/pgcli | 666aeee79f849d4a8d02d2860b2f33a9bd105e93 | [
"BSD-3-Clause"
] | null | null | null | tests/test_pgexecute.py | isabella232/pgcli | 666aeee79f849d4a8d02d2860b2f33a9bd105e93 | [
"BSD-3-Clause"
] | null | null | null | tests/test_pgexecute.py | isabella232/pgcli | 666aeee79f849d4a8d02d2860b2f33a9bd105e93 | [
"BSD-3-Clause"
] | 1 | 2022-03-26T12:14:13.000Z | 2022-03-26T12:14:13.000Z | # coding=UTF-8
import pytest
import psycopg2
from pgspecial.main import PGSpecial
from pgcli.packages.parseutils.meta import FunctionMetadata
from textwrap import dedent
from utils import run, dbtest, requires_json, requires_jsonb
@dbtest
def test_conn(executor):
run(executor, '''create table test(a text)''')
... | 36.105263 | 113 | 0.635374 |
0f8d1db1448738a26b19249768786eff826d8d8c | 1,594 | py | Python | src/caiso_connector.py | caheredia/caiso_connector | a445bddd0eb953800b07accbd639864d3f8289d1 | [
"MIT"
] | 2 | 2021-09-09T12:25:40.000Z | 2022-01-29T02:30:47.000Z | src/caiso_connector.py | caheredia/caiso_connector | a445bddd0eb953800b07accbd639864d3f8289d1 | [
"MIT"
] | 43 | 2020-06-14T02:13:23.000Z | 2020-08-08T20:11:21.000Z | src/caiso_connector.py | caheredia/caiso_connector | a445bddd0eb953800b07accbd639864d3f8289d1 | [
"MIT"
] | null | null | null | import os
import zipfile
from urllib import request
def download_csv_file(data_url: str, directory_path: str):
"""Download csv file.
Parameters
----------
data_url : str
source url for data
directory_path : str
location of saved zipped file
"""
request.urlretrieve(data_url... | 24.523077 | 68 | 0.632999 |
92254ce1cdad955d08b6062fde82ccb31a0392f8 | 6,215 | py | Python | venv/Lib/site-packages/PySide6/examples/widgets/tutorials/addressbook/part2.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PySide6/examples/widgets/tutorials/addressbook/part2.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PySide6/examples/widgets/tutorials/addressbook/part2.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null |
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## ... | 34.337017 | 77 | 0.646179 |
79a09901502f3a7f751fa46057bed2f2e457de09 | 463 | py | Python | moneydog/filters.py | Falldog/moneydog | 86e7cab1c0b35f07d1fe42e699e1159f57f1bef5 | [
"Apache-2.0"
] | null | null | null | moneydog/filters.py | Falldog/moneydog | 86e7cab1c0b35f07d1fe42e699e1159f57f1bef5 | [
"Apache-2.0"
] | null | null | null | moneydog/filters.py | Falldog/moneydog | 86e7cab1c0b35f07d1fe42e699e1159f57f1bef5 | [
"Apache-2.0"
] | null | null | null | from moneydog import app
from moneydog.models import str2category, category2str
from datetime import date
app.jinja_env.filters['str2category'] = str2category
app.jinja_env.filters['category2str'] = category2str
@app.template_filter('reverse')
def reverse_filter(s):
return s[::-1]
@app.template_fi... | 23.15 | 55 | 0.710583 |
5d1e56814d7b66cb9bbb51d53add4ba689ac9ea2 | 11,118 | py | Python | pyqtgraph/widgets/ColorMapWidget.py | nodedge/pyqtgraph | 5a08650853a339c383281fd531fe059b74e1bbcd | [
"MIT"
] | 1 | 2021-04-28T05:16:24.000Z | 2021-04-28T05:16:24.000Z | pyqtgraph/widgets/ColorMapWidget.py | nodedge/pyqtgraph | 5a08650853a339c383281fd531fe059b74e1bbcd | [
"MIT"
] | 6 | 2021-06-16T23:53:21.000Z | 2021-06-22T04:05:09.000Z | pyqtgraph/widgets/ColorMapWidget.py | nodedge/pyqtgraph | 5a08650853a339c383281fd531fe059b74e1bbcd | [
"MIT"
] | 1 | 2021-03-26T09:45:36.000Z | 2021-03-26T09:45:36.000Z | from ..Qt import QtGui, QtCore
from .. import parametertree as ptree
import numpy as np
from collections import OrderedDict
from .. import functions as fn
__all__ = ['ColorMapWidget']
class ColorMapWidget(ptree.ParameterTree):
"""
This class provides a widget allowing the user to customize color mapping
f... | 40.137184 | 115 | 0.520327 |
29fb078c2c5ba91af2f17ef45be758878c10c340 | 451 | py | Python | src/pretix/plugins/paypal/urls.py | alainrk/pretix | 867a8132aa1ed73dd9513efae5b3c46b5bbae140 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-08-31T13:16:55.000Z | 2021-08-31T13:16:55.000Z | src/pretix/plugins/paypal/urls.py | alainrk/pretix | 867a8132aa1ed73dd9513efae5b3c46b5bbae140 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/paypal/urls.py | alainrk/pretix | 867a8132aa1ed73dd9513efae5b3c46b5bbae140 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from django.conf.urls import include, url
from .views import abort, refund, success, webhook
event_patterns = [
url(r'^paypal/', include([
url(r'^abort/$', abort, name='abort'),
url(r'^return/$', success, name='return'),
url(r'^webhook/$', webhook, name='webhook'),
])),
]
urlpatterns... | 25.055556 | 91 | 0.574279 |
76235a868ed79922d98b6044ae641b08036f742c | 4,442 | py | Python | bin/printwltcclass.py | qinfeng2011/wltp | 317ad38fb96599a29d22e40f69b6aeb4d205611d | [
"Apache-2.0"
] | null | null | null | bin/printwltcclass.py | qinfeng2011/wltp | 317ad38fb96599a29d22e40f69b6aeb4d205611d | [
"Apache-2.0"
] | null | null | null | bin/printwltcclass.py | qinfeng2011/wltp | 317ad38fb96599a29d22e40f69b6aeb4d205611d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2019 European Commission (JRC);
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
"""Build a python array from reading WL... | 29.613333 | 95 | 0.593652 |
6df92f02388c809666aa8ec74e474d04bfc2dbd9 | 2,406 | py | Python | config/log.py | zhouhongf/spider_pdf | c059f0003b5c8a2dab1e735ff456ba2bc9c799ac | [
"MIT"
] | 1 | 2021-11-27T06:40:45.000Z | 2021-11-27T06:40:45.000Z | config/log.py | zhouhongf/spider_pdf | c059f0003b5c8a2dab1e735ff456ba2bc9c799ac | [
"MIT"
] | null | null | null | config/log.py | zhouhongf/spider_pdf | c059f0003b5c8a2dab1e735ff456ba2bc9c799ac | [
"MIT"
] | 1 | 2022-01-15T07:48:38.000Z | 2022-01-15T07:48:38.000Z | import logging
from logging import handlers
import os
from config import Config
class Logger:
level_relations = {
'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.ERROR,
'crit': logging.CRITICAL
}
fmt = '%(... | 39.442623 | 151 | 0.5798 |
70ea18bb1b77743ed66963eabc10c52b12b9c22a | 11,032 | py | Python | build/PureCloudPlatformClientV2/models/voicemail_group_policy.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | build/PureCloudPlatformClientV2/models/voicemail_group_policy.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | build/PureCloudPlatformClientV2/models/voicemail_group_policy.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 32.163265 | 184 | 0.630529 |
e9d85ba06e013beed68dbb8eb70c6d1b720d24ef | 19,480 | py | Python | controls/forms.py | rossm6/accounts | 74633ce4038806222048d85ef9dfe97a957a6a71 | [
"MIT"
] | 11 | 2021-01-23T01:09:54.000Z | 2021-01-25T07:16:30.000Z | controls/forms.py | rossm6/accounts | 74633ce4038806222048d85ef9dfe97a957a6a71 | [
"MIT"
] | 7 | 2021-04-06T18:19:10.000Z | 2021-09-22T19:45:03.000Z | controls/forms.py | rossm6/accounts | 74633ce4038806222048d85ef9dfe97a957a6a71 | [
"MIT"
] | 3 | 2021-01-23T18:55:32.000Z | 2021-02-16T17:47:59.000Z | from itertools import groupby
from accountancy.fields import (ModelChoiceIteratorWithFields,
ModelMultipleChoiceFieldChooseIterator)
from accountancy.helpers import sort_multiple
from accountancy.layouts import (AdjustPeriod, Delete, Div, Field,
FieldAnd... | 34.785714 | 137 | 0.480133 |
f4139c233d3ba544bfbbbdf431784b7167593055 | 278 | py | Python | notes/lecture-2/50-homework/lecture-2.py | numpyLearningGroup/numpy-learn | 847d542f6541715f5842510911dd80eab4c6a44a | [
"MIT"
] | null | null | null | notes/lecture-2/50-homework/lecture-2.py | numpyLearningGroup/numpy-learn | 847d542f6541715f5842510911dd80eab4c6a44a | [
"MIT"
] | null | null | null | notes/lecture-2/50-homework/lecture-2.py | numpyLearningGroup/numpy-learn | 847d542f6541715f5842510911dd80eab4c6a44a | [
"MIT"
] | null | null | null | import numpy as np
# 对一维数组的切片
origin = np.arange(1,100)
print(origin)
print(origin[0:2])
print(origin[:12:4])
print(origin[:12:])
print(origin[5:])
print(origin[::-1]) #倒序
# 二维数组切片
origin = np.random.random((3,4))
print(origin)
print(origin[-2:,:2])
print(origin[::-2,::-1]) | 16.352941 | 32 | 0.658273 |
800ee1ec66ef82f61230ff839b9a40489bd78b54 | 6,696 | py | Python | third_party/WebKit/Tools/Scripts/webkitpy/style/filereader_unittest.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | third_party/WebKit/Tools/Scripts/webkitpy/style/filereader_unittest.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | third_party/WebKit/Tools/Scripts/webkitpy/style/filereader_unittest.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | 43.480519 | 108 | 0.703106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.