hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f720e6032cfc7932950462b55a729037d787591f | 404 | py | Python | AboutModel/migrations/0006_person_upload.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | AboutModel/migrations/0006_person_upload.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | AboutModel/migrations/0006_person_upload.py | jinjinanan/HelloDjango1 | d1174b72341946f0575df37236d85983facc1bc6 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2018-09-26 09:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AboutModel', '0005_auto_20180926_1639'),
]
operations = [
migrations.AddField(
model_name='person',
name='upload',
... | 21.263158 | 67 | 0.596535 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AboutModel', '0005_auto_20180926_1639'),
]
operations = [
migrations.AddField(
model_name='person',
name='upload',
field=models.FileField(default='', u... | true | true |
f720e775b9e53621d7ef0b929530a0e01f683291 | 216 | py | Python | display/display/handlers/calendar/calendar.py | owlsn/h_crawl | c0431ee6484e61d9339553c3350962ea517749d6 | [
"MIT"
] | null | null | null | display/display/handlers/calendar/calendar.py | owlsn/h_crawl | c0431ee6484e61d9339553c3350962ea517749d6 | [
"MIT"
] | 8 | 2021-03-18T20:33:29.000Z | 2022-03-11T23:21:04.000Z | display/display/handlers/calendar/calendar.py | owlsn/h_crawl | c0431ee6484e61d9339553c3350962ea517749d6 | [
"MIT"
] | null | null | null | from display.handlers.base import BaseHandler
class CalendarHandler(BaseHandler):
def get(self):
title = 'CalendarHandler'
self.render('calendar/calendar.html', title = title, **self.render_dict) | 36 | 80 | 0.722222 | from display.handlers.base import BaseHandler
class CalendarHandler(BaseHandler):
def get(self):
title = 'CalendarHandler'
self.render('calendar/calendar.html', title = title, **self.render_dict) | true | true |
f720e782756412b8e32b05c6b3b8cd42bb215506 | 298 | py | Python | 1.py | lorenaEscobar0014/TALLER-DE-FOR | a448358b336d6e240ff3017a9c44d7df67bf173e | [
"MIT"
] | null | null | null | 1.py | lorenaEscobar0014/TALLER-DE-FOR | a448358b336d6e240ff3017a9c44d7df67bf173e | [
"MIT"
] | null | null | null | 1.py | lorenaEscobar0014/TALLER-DE-FOR | a448358b336d6e240ff3017a9c44d7df67bf173e | [
"MIT"
] | null | null | null | archivo = open('paises.txt', 'r')
lista = []
ciudad = []
for i in archivo:
a = i.index(":")
for r in range(a+2, len(i)):
lista.append(i[r])
a = "".join(lista)
ciudad.append(a)
lista = []
for i in ciudad:
if(i[0] == "M"):
print(i)
lista.append(i)
print(len(lista))
archivo.close() | 18.625 | 33 | 0.57047 | archivo = open('paises.txt', 'r')
lista = []
ciudad = []
for i in archivo:
a = i.index(":")
for r in range(a+2, len(i)):
lista.append(i[r])
a = "".join(lista)
ciudad.append(a)
lista = []
for i in ciudad:
if(i[0] == "M"):
print(i)
lista.append(i)
print(len(lista))
archivo.close() | true | true |
f720e79407295f9aac9a3426d1cae24917442d5c | 2,720 | py | Python | src/pipelines/vaccinations/se_authority.py | chrismayemba/covid-19-open-data | cacecb05cd8277f8e61b6e7932915826f41af24b | [
"Apache-2.0"
] | 1 | 2021-10-21T15:24:08.000Z | 2021-10-21T15:24:08.000Z | src/pipelines/vaccinations/se_authority.py | chrismayemba/covid-19-open-data | cacecb05cd8277f8e61b6e7932915826f41af24b | [
"Apache-2.0"
] | null | null | null | src/pipelines/vaccinations/se_authority.py | chrismayemba/covid-19-open-data | cacecb05cd8277f8e61b6e7932915826f41af24b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 40 | 100 | 0.683088 |
import datetime
from typing import Any, Dict
from pandas import DataFrame, concat
from lib.data_source import DataSource
from lib.time import datetime_isoformat
from lib.utils import aggregate_admin_level, table_merge, table_rename
from pipelines.epidemiology.it_authority import _subregion1_code_converter... | true | true |
f720e7b3881bb7f2ca7c123f52d4f902222b4dac | 2,385 | py | Python | imblearn/under_sampling/_prototype_selection/tests/test_instance_hardness_threshold.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | imblearn/under_sampling/_prototype_selection/tests/test_instance_hardness_threshold.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | imblearn/under_sampling/_prototype_selection/tests/test_instance_hardness_threshold.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | """Test the module ."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import pytest
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from imblearn.under_sampling import InstanceHardnessThreshold
RND_SEED = 0
X = np.array(
[
[-0... | 30.189873 | 77 | 0.678826 |
import pytest
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from imblearn.under_sampling import InstanceHardnessThreshold
RND_SEED = 0
X = np.array(
[
[-0.3879569, 0.6894251],
[-0.09322739, 1.28177189],
[-0.77740357, 0.74097941],
[0.91542919, -0.65... | true | true |
f720e859b033940aead6b8c6f677e377794adbc7 | 798 | py | Python | piton/lib/readchar/readchar.py | piton-package-manager/PPM | 19015b76184befe1e2daa63189a13b039787868d | [
"MIT"
] | 19 | 2016-04-08T04:00:07.000Z | 2021-11-12T19:36:56.000Z | piton/lib/readchar/readchar.py | LookLikeAPro/PPM | 19015b76184befe1e2daa63189a13b039787868d | [
"MIT"
] | 9 | 2017-01-03T13:39:47.000Z | 2022-01-15T20:38:20.000Z | piton/lib/readchar/readchar.py | LookLikeAPro/PPM | 19015b76184befe1e2daa63189a13b039787868d | [
"MIT"
] | 6 | 2017-04-01T03:38:45.000Z | 2021-05-06T11:25:31.000Z | # -*- coding: utf-8 -*-
# This file is based on this gist:
# http://code.activestate.com/recipes/134892/
# So real authors are DannyYoo and company.
import sys
if sys.platform.startswith('linux'):
from .readchar_linux import readchar
elif sys.platform == 'darwin':
from .readchar_linux import readchar
elif sys... | 25.741935 | 79 | 0.645363 |
import sys
if sys.platform.startswith('linux'):
from .readchar_linux import readchar
elif sys.platform == 'darwin':
from .readchar_linux import readchar
elif sys.platform in ('win32', 'cygwin'):
from .readchar_windows import readchar
else:
raise NotImplemented('The platform %s is not supported yet... | true | true |
f720e8b77258c01a05c510ec80e3283dcdbe46b3 | 1,698 | py | Python | leetcode/combination_sum_III.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | leetcode/combination_sum_III.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | leetcode/combination_sum_III.py | sci-c0/python-misc-problems | a0827cc9cd290ca142bba3b7dda307234da63c3c | [
"BSD-3-Clause"
] | null | null | null | """
https://leetcode.com/problems/combination-sum-iii/
Tags: Practice; Concepts; Algorithms; Recursion/BackTracking; Medium
"""
from typing import List
class Solution:
def combinationSum3(self, k: int, n: int) -> List[List[int]]:
# Create a list of nums to choose fromx
return self.combi... | 32.653846 | 114 | 0.579505 |
from typing import List
class Solution:
def combinationSum3(self, k: int, n: int) -> List[List[int]]:
return self.combinations(list(range(1, 10)), [], n, k)
def combinations(self, nums: List[int], combi: List[int], s: int, k: int):
ans = []
if len(combi) == k - 1... | true | true |
f720e94c7b98eefd4db2a78ffdc2366c09186edd | 942 | py | Python | hypernet/src/thermophysicalModels/chemistry/reactions/reactionRate/arrhenius.py | christian-jacobsen/hypernet | 9f62e1531eb152cc08af0b0c6b09d6fde8d42400 | [
"Apache-2.0"
] | null | null | null | hypernet/src/thermophysicalModels/chemistry/reactions/reactionRate/arrhenius.py | christian-jacobsen/hypernet | 9f62e1531eb152cc08af0b0c6b09d6fde8d42400 | [
"Apache-2.0"
] | null | null | null | hypernet/src/thermophysicalModels/chemistry/reactions/reactionRate/arrhenius.py | christian-jacobsen/hypernet | 9f62e1531eb152cc08af0b0c6b09d6fde8d42400 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from hypernet.src.thermophysicalModels.chemistry.reactions.reactionRate import Basic
class Arrhenius(Basic):
# Initialization
###########################################################################
def __init__(
self,
reactionsDatabase,
*args,
**kwa... | 28.545455 | 84 | 0.440552 | import numpy as np
from hypernet.src.thermophysicalModels.chemistry.reactions.reactionRate import Basic
class Arrhenius(Basic):
| true | true |
f720eaa230ec470ea6eabf1b1bc884458772e552 | 9,670 | py | Python | qpth/qp.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | qpth/qp.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | qpth/qp.py | lopa23/flim_optcrf | 2d9a1dba37a7e5e6beae66c536b07bb7ae4bdfe9 | [
"Apache-2.0"
] | null | null | null | import torch
from torch.autograd import Function
from .util import bger, expandParam, extract_nBatch
from . import solvers
from .solvers.pdipm import batch as pdipm_b
from .solvers.pdipm import spbatch as pdipm_spb
# from .solvers.pdipm import single as pdipm_s
from enum import Enum
class QPSolvers(Enum):
PDIPM... | 37.773438 | 84 | 0.512099 | import torch
from torch.autograd import Function
from .util import bger, expandParam, extract_nBatch
from . import solvers
from .solvers.pdipm import batch as pdipm_b
from .solvers.pdipm import spbatch as pdipm_spb
from enum import Enum
class QPSolvers(Enum):
PDIPM_BATCHED = 1
CVXPY = 2
def QPFunction(ep... | true | true |
f720ef19782f7092c0e07d4d635eb810543e0ea4 | 9,608 | py | Python | tests/functional/tests/management/test_add_remove.py | beef9999/ocf | 4d1b086956e3019456fa86c33954eeb53cfeab9e | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/functional/tests/management/test_add_remove.py | beef9999/ocf | 4d1b086956e3019456fa86c33954eeb53cfeab9e | [
"BSD-3-Clause-Clear"
] | null | null | null | tests/functional/tests/management/test_add_remove.py | beef9999/ocf | 4d1b086956e3019456fa86c33954eeb53cfeab9e | [
"BSD-3-Clause-Clear"
] | null | null | null | # Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import pytest
from ctypes import c_int
from random import randint
from pyocf.types.cache import Cache, CacheMode
from pyocf.types.core import Core
from pyocf.types.volume import Volume
from pyocf.types.data import Data
from pyo... | 30.405063 | 82 | 0.679954 |
import pytest
from ctypes import c_int
from random import randint
from pyocf.types.cache import Cache, CacheMode
from pyocf.types.core import Core
from pyocf.types.volume import Volume
from pyocf.types.data import Data
from pyocf.types.io import IoDir
from pyocf.utils import Size as S
from pyocf.types.shared impor... | true | true |
f720efc3c7a943431ee1490b8c525586b3496e7e | 98 | py | Python | game/forms.py | mingaleg/yakubovich | 95398c78eaffbd6ff69f8fdbedfc847531219d8a | [
"MIT"
] | 5 | 2018-12-12T16:24:42.000Z | 2020-02-29T18:45:30.000Z | game/forms.py | mingaleg/yakubovich | 95398c78eaffbd6ff69f8fdbedfc847531219d8a | [
"MIT"
] | 3 | 2020-06-05T17:47:13.000Z | 2022-02-11T03:39:54.000Z | game/forms.py | mingaleg/yakubovich | 95398c78eaffbd6ff69f8fdbedfc847531219d8a | [
"MIT"
] | null | null | null | from django import forms
class GuessForm(forms.Form):
guess = forms.CharField(max_length=32) | 19.6 | 42 | 0.765306 | from django import forms
class GuessForm(forms.Form):
guess = forms.CharField(max_length=32) | true | true |
f720f0cdfccab7e5f9e79ca3a814fc670b37f244 | 7,403 | py | Python | packages/syft/src/syft/core/node/network.py | Noob-can-Compile/PySyft | 156cf93489b16dd0205b0058d4d23d56b3a91ab8 | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/network.py | Noob-can-Compile/PySyft | 156cf93489b16dd0205b0058d4d23d56b3a91ab8 | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/network.py | Noob-can-Compile/PySyft | 156cf93489b16dd0205b0058d4d23d56b3a91ab8 | [
"Apache-2.0"
] | null | null | null | # future
from __future__ import annotations
# stdlib
import os
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Union
# third party
import ascii_magic
from nacl.signing import SigningKey
from nacl.signing import VerifyKey
from pydantic import BaseSe... | 35.763285 | 87 | 0.694178 |
from __future__ import annotations
import os
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Union
import ascii_magic
from nacl.signing import SigningKey
from nacl.signing import VerifyKey
from pydantic import BaseSettings
from ...lib.python i... | true | true |
f720f0e6e33f0328fc6c7ca0e2c409dffe494e2d | 469 | py | Python | rest/taskrouter/activities/list/get/example-1/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2017-11-23T11:31:20.000Z | 2018-01-22T04:14:02.000Z | rest/taskrouter/activities/list/get/example-1/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/taskrouter/activities/list/get/example-1/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2020-05-22T23:31:21.000Z | 2021-06-10T18:33:45.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioTaskRouterClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
... | 36.076923 | 72 | 0.831557 |
from twilio.rest import TwilioTaskRouterClient
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client = TwilioTaskRouterClient(account_sid, auth_token)
for activity in client.activities(workspace_sid).list():
print(activity.... | true | true |
f720f0e9572244aa93d948eff6a96fb8c4142ebe | 26,980 | py | Python | lang/python/github/com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder_pb2.py | metaprov/modelaapi | 64ab493dd73329196235e15776e5177c72281990 | [
"Apache-2.0"
] | 5 | 2022-02-18T03:40:10.000Z | 2022-03-01T16:11:24.000Z | lang/python/github/com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder_pb2.py | metaprov/modelaapi | 64ab493dd73329196235e15776e5177c72281990 | [
"Apache-2.0"
] | 1 | 2022-01-07T19:59:25.000Z | 2022-02-04T01:21:14.000Z | lang/python/github/com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder_pb2.py | metaprov/modelaapi | 64ab493dd73329196235e15776e5177c72281990 | [
"Apache-2.0"
] | 1 | 2022-03-25T10:21:43.000Z | 2022-03-25T10:21:43.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: github.com/metaprov/modelaapi/services/modelautobuilder/v1/modelautobuilder.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | 48.092692 | 3,212 | 0.807969 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.api import annotations_pb2 as google_dot_api... | true | true |
f720f1e95b326e40c9aeac42acdf9e1f3addaa58 | 753 | py | Python | tests/instructions/test_tfr.py | rob-smallshire/asm68 | a9bbb99e7a7fbbe7656815df488c74606d08b252 | [
"X11"
] | null | null | null | tests/instructions/test_tfr.py | rob-smallshire/asm68 | a9bbb99e7a7fbbe7656815df488c74606d08b252 | [
"X11"
] | null | null | null | tests/instructions/test_tfr.py | rob-smallshire/asm68 | a9bbb99e7a7fbbe7656815df488c74606d08b252 | [
"X11"
] | 1 | 2018-05-08T11:03:22.000Z | 2018-05-08T11:03:22.000Z | from asm68.registers import *
from asm68.mnemonics import TFR
from asm68.asmdsl import AsmDsl, statements
from asm68.assembler import assemble, InterRegisterError
from helpers.code import check_object_code
from pytest import raises
def test_tfr_a_a():
check_object_code('1F 88', TFR, (A, A))
def test_tfr_a_b():
... | 23.53125 | 56 | 0.718459 | from asm68.registers import *
from asm68.mnemonics import TFR
from asm68.asmdsl import AsmDsl, statements
from asm68.assembler import assemble, InterRegisterError
from helpers.code import check_object_code
from pytest import raises
def test_tfr_a_a():
check_object_code('1F 88', TFR, (A, A))
def test_tfr_a_b():
... | true | true |
f720f269f987186e910ee271a51453fc316eb7d7 | 4,231 | py | Python | tests/sender/cli.py | OvidiuMM/python-sdk | 8e5c4e5b00de1269f75d44e7614d2d8d5c934b3b | [
"MIT"
] | 2 | 2020-07-20T09:07:12.000Z | 2020-07-20T09:56:21.000Z | tests/sender/cli.py | OvidiuMM/python-sdk | 8e5c4e5b00de1269f75d44e7614d2d8d5c934b3b | [
"MIT"
] | null | null | null | tests/sender/cli.py | OvidiuMM/python-sdk | 8e5c4e5b00de1269f75d44e7614d2d8d5c934b3b | [
"MIT"
] | null | null | null | import unittest
import socket
from click.testing import CliRunner
from devo.common import Configuration
from devo.sender.scripts.sender_cli import data
from devo.sender import DevoSenderException
try:
from .load_certs import *
except ImportError:
from load_certs import *
class TestSender(unittest.TestCase):
... | 40.295238 | 77 | 0.523044 | import unittest
import socket
from click.testing import CliRunner
from devo.common import Configuration
from devo.sender.scripts.sender_cli import data
from devo.sender import DevoSenderException
try:
from .load_certs import *
except ImportError:
from load_certs import *
class TestSender(unittest.TestCase):
... | true | true |
f720f373767dfe318e91d21f618da8dedddfa285 | 3,700 | py | Python | examples/poisson_test.py | intact-solutions/pysparse | f3dca3ae9d02ab3f49486fbae5d9d68059a318ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/poisson_test.py | intact-solutions/pysparse | f3dca3ae9d02ab3f49486fbae5d9d68059a318ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/poisson_test.py | intact-solutions/pysparse | f3dca3ae9d02ab3f49486fbae5d9d68059a318ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import numpy as np
import math
from pysparse.sparse import spmatrix
from pysparse.itsolvers.krylov import pcg, qmrs
from pysparse.precon import precon
import time
def poisson2d(n):
L = spmatrix.ll_mat(n*n, n*n)
for i in range(n):
for j in range(n):
k = i + n*j
L[k,k] = 4
... | 25 | 100 | 0.481081 | import numpy as np
import math
from pysparse.sparse import spmatrix
from pysparse.itsolvers.krylov import pcg, qmrs
from pysparse.precon import precon
import time
def poisson2d(n):
L = spmatrix.ll_mat(n*n, n*n)
for i in range(n):
for j in range(n):
k = i + n*j
L[k,k] = 4
... | true | true |
f720f3ad35136c86211956b945ba2de3bd65784c | 170 | py | Python | scripts/item/consume_2432355.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/item/consume_2432355.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/item/consume_2432355.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | # Snowflake Damage Skin
success = sm.addDamageSkin(2432355)
if success:
sm.chat("The Snowflake Damage Skin has been added to your account's damage skin collection.")
| 34 | 97 | 0.770588 |
success = sm.addDamageSkin(2432355)
if success:
sm.chat("The Snowflake Damage Skin has been added to your account's damage skin collection.")
| true | true |
f720f5d9454e5ea4b2e9262d909e29b9ee507501 | 1,314 | py | Python | app/core/tests/test_admin.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='royandri.dev@gmail.com',
... | 31.285714 | 68 | 0.637747 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='royandri.dev@gmail.com',
... | true | true |
f720f7d7aa6b5c6b8450862f0abd2256a26a8136 | 58 | py | Python | www/speed/benchmarks/function_call.py | olemis/brython | 3ef4a602eed5a75130e507707579ad9aa2dc3e5c | [
"BSD-3-Clause"
] | 2 | 2018-06-09T15:29:48.000Z | 2019-11-13T09:15:08.000Z | www/speed/benchmarks/function_call.py | olemis/brython | 3ef4a602eed5a75130e507707579ad9aa2dc3e5c | [
"BSD-3-Clause"
] | 2 | 2017-04-14T03:52:41.000Z | 2017-04-14T04:02:06.000Z | client/components/ide/brython/www/speed/benchmarks/function_call.py | pascualy/coding_blind | 420947c61ec3cd0169d5a25f7b01ae6df9541607 | [
"MIT"
] | 2 | 2018-02-22T09:48:18.000Z | 2020-06-04T17:00:09.000Z | def f(x):
return x
for i in range(1000000):
f(i)
| 9.666667 | 24 | 0.551724 | def f(x):
return x
for i in range(1000000):
f(i)
| true | true |
f720f8eccc250efd8c3d430ddb9ee9afde19d1ec | 4,224 | py | Python | lmctl/cli/commands/targets/behaviour_projects.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 3 | 2021-07-19T09:46:01.000Z | 2022-03-07T13:51:25.000Z | lmctl/cli/commands/targets/behaviour_projects.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 43 | 2019-08-27T12:36:29.000Z | 2020-08-27T14:50:40.000Z | lmctl/cli/commands/targets/behaviour_projects.py | manojn97/lmctl | 844925cb414722351efac90cb97f10c1185eef7a | [
"Apache-2.0"
] | 7 | 2020-09-22T20:32:17.000Z | 2022-03-29T12:25:51.000Z | import click
from typing import Dict
from lmctl.client import TNCOClient, TNCOClientHttpError
from lmctl.cli.arguments import common_output_format_handler
from lmctl.cli.format import Table, Column
from .tnco_target import TNCOTarget, LmGet, LmCreate, LmUpdate, LmDelete, LmGen
class ProjectTable(Table):
colum... | 44.93617 | 189 | 0.60535 | import click
from typing import Dict
from lmctl.client import TNCOClient, TNCOClientHttpError
from lmctl.cli.arguments import common_output_format_handler
from lmctl.cli.format import Table, Column
from .tnco_target import TNCOTarget, LmGet, LmCreate, LmUpdate, LmDelete, LmGen
class ProjectTable(Table):
colum... | true | true |
f720f90efb06d99eed40521f7e2ae957d0796d80 | 6,907 | py | Python | toontown/coghq/DistributedMintRoom.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | toontown/coghq/DistributedMintRoom.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | toontown/coghq/DistributedMintRoom.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from panda3d.core import *
import random
import FactoryEntityCreator
import MintRoomBase, MintRoom
import MintRoomSpecs
from otp.level import DistributedLevel
from otp.level impor... | 32.734597 | 222 | 0.668018 | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from panda3d.core import *
import random
import FactoryEntityCreator
import MintRoomBase, MintRoom
import MintRoomSpecs
from otp.level import DistributedLevel
from otp.level impor... | false | true |
f720f9e7fd9b231b60cfa0de9c50219e99364bef | 2,516 | py | Python | api/serializers.py | NiklasMerz/shoppinglist | 38c494b2a2f80a0c543beaf0d9d9a75870bdbb22 | [
"MIT"
] | null | null | null | api/serializers.py | NiklasMerz/shoppinglist | 38c494b2a2f80a0c543beaf0d9d9a75870bdbb22 | [
"MIT"
] | 45 | 2021-11-03T20:48:50.000Z | 2021-12-14T21:22:12.000Z | api/serializers.py | NiklasMerz/shoppinglist | 38c494b2a2f80a0c543beaf0d9d9a75870bdbb22 | [
"MIT"
] | null | null | null | from list.models import *
from rest_framework import serializers
class CatalogItemSerializer(serializers.ModelSerializer):
class Meta:
model = CatalogItem
fields = ['id', 'description']
class ItemSerializer(serializers.ModelSerializer):
last_checkout = serializers.SerializerMethodField()
... | 33.546667 | 165 | 0.661367 | from list.models import *
from rest_framework import serializers
class CatalogItemSerializer(serializers.ModelSerializer):
class Meta:
model = CatalogItem
fields = ['id', 'description']
class ItemSerializer(serializers.ModelSerializer):
last_checkout = serializers.SerializerMethodField()
... | true | true |
f720fb43dcf64ffc735cf5c4010db34b4ad229a7 | 8,091 | py | Python | tests/test_cli_exiftool.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | tests/test_cli_exiftool.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | tests/test_cli_exiftool.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | """Tests for `osxphotos exiftool` command."""
import glob
import json
import os
import pytest
from click.testing import CliRunner
from osxphotos.cli.exiftool_cli import exiftool
from osxphotos.cli.export import export
from osxphotos.exiftool import ExifTool, get_exiftool_path
from .test_cli import CLI_EXIFTOOL, PHO... | 30.303371 | 88 | 0.502163 |
import glob
import json
import os
import pytest
from click.testing import CliRunner
from osxphotos.cli.exiftool_cli import exiftool
from osxphotos.cli.export import export
from osxphotos.exiftool import ExifTool, get_exiftool_path
from .test_cli import CLI_EXIFTOOL, PHOTOS_DB_15_7
try:
exiftool_path = get_exi... | true | true |
f720fb57cc3918cd168d86f2c7f319f139afdefb | 1,488 | py | Python | datasets/raman_tablets/__init__.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 3 | 2019-03-18T03:22:06.000Z | 2021-04-06T07:53:51.000Z | datasets/raman_tablets/__init__.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | null | null | null | datasets/raman_tablets/__init__.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 2 | 2020-10-05T08:22:25.000Z | 2020-10-05T08:24:02.000Z | #!/usr/bin/env
# -*- coding: utf-8 -*-
# Copyright (C) Victor M. Mendiola Lau - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, February 2017
import os
import scipy.io as sio
import... | 29.76 | 93 | 0.635753 |
import os
import scipy.io as sio
import utils.datasets as utils
__data_set_path = "{}/data/Ramandata_tablets.mat".format(os.path.split(__file__)[0])
__pickle_path = "{}/cache/raman_tablets.pickle".format(os.path.split(__file__)[0])
@utils.load_data_from_pickle(__pickle_path)
def load_raman_tablets()... | true | true |
f720fb60277344026d5780ac04e0013b225304fb | 4,616 | py | Python | homeassistant/components/climate/homekit_controller.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | homeassistant/components/climate/homekit_controller.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:25:50.000Z | 2022-03-11T23:27:53.000Z | homeassistant/components/climate/homekit_controller.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 3 | 2018-09-14T07:34:09.000Z | 2018-09-29T12:57:10.000Z | """
Support for Homekit climate devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.homekit_controller/
"""
import logging
from homeassistant.components.homekit_controller import (
HomeKitEntity, KNOWN_ACCESSORIES)
from homeassistant.com... | 35.236641 | 79 | 0.649697 | import logging
from homeassistant.components.homekit_controller import (
HomeKitEntity, KNOWN_ACCESSORIES)
from homeassistant.components.climate import (
ClimateDevice, STATE_HEAT, STATE_COOL, STATE_IDLE,
SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE)
from homeassistant.const import TEMP_CELSIUS, STAT... | true | true |
f720fb753855fb74cefd74341a9ca1be69022a34 | 247 | py | Python | frappe/patches/v5_3/rename_chinese_languages.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | 1 | 2021-06-03T07:04:48.000Z | 2021-06-03T07:04:48.000Z | frappe/patches/v5_3/rename_chinese_languages.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | null | null | null | frappe/patches/v5_3/rename_chinese_languages.py | Nxweb-in/frappe | 56b3eb52bf56dd71bee29fde3ed28ed9c6d15947 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import frappe
from frappe.translate import rename_language
def execute():
language_map = {
"中国(简体)": "簡體中文",
"中國(繁體)": "正體中文"
}
for old_name, new_name in language_map.items():
rename_language(old_name, new_name)
| 19 | 48 | 0.684211 |
import frappe
from frappe.translate import rename_language
def execute():
language_map = {
"中国(简体)": "簡體中文",
"中國(繁體)": "正體中文"
}
for old_name, new_name in language_map.items():
rename_language(old_name, new_name)
| true | true |
f720fbff40e522e9a078688ae64f8333f985dc4f | 110 | py | Python | video.py | KazukiChiyo/lane-keeping | 46ac1ce2cb96eb32a0da4946433c8d0ecbf4dc53 | [
"MIT"
] | 1 | 2018-10-09T12:59:30.000Z | 2018-10-09T12:59:30.000Z | video.py | KazukiChiyo/lane-keeping | 46ac1ce2cb96eb32a0da4946433c8d0ecbf4dc53 | [
"MIT"
] | null | null | null | video.py | KazukiChiyo/lane-keeping | 46ac1ce2cb96eb32a0da4946433c8d0ecbf4dc53 | [
"MIT"
] | 1 | 2020-05-22T05:57:29.000Z | 2020-05-22T05:57:29.000Z | from moviepy.editor import VideoFileClip
clip = VideoFileClip("output_images/out_video.mp4")
print(clip.fps)
| 22 | 51 | 0.818182 | from moviepy.editor import VideoFileClip
clip = VideoFileClip("output_images/out_video.mp4")
print(clip.fps)
| true | true |
f720fc48a7b225366d7031ba6afe3845468b78f8 | 5,354 | py | Python | tests/test_node_licenses.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | tests/test_node_licenses.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | tests/test_node_licenses.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | # -*- coding: utf-8 -*-
import builtins
import json
import unittest
import mock
import pytest
from django.core.exceptions import ValidationError
from nose.tools import * # noqa: F403 (PEP8 asserts)
from framework.auth import Auth
from osf_tests.factories import (AuthUserFactory, NodeLicenseRecordFactory,
... | 37.704225 | 98 | 0.678371 |
import builtins
import json
import unittest
import mock
import pytest
from django.core.exceptions import ValidationError
from nose.tools import *
from framework.auth import Auth
from osf_tests.factories import (AuthUserFactory, NodeLicenseRecordFactory,
ProjectFactory)
from tests.b... | true | true |
f720fc870a26f0386b206c00d49fa2c271f5ac7a | 6,675 | py | Python | cavalgada_do_mar/src/webapps/website.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | cavalgada_do_mar/src/webapps/website.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | 1 | 2015-11-08T11:49:35.000Z | 2015-11-08T11:49:43.000Z | cavalgada_do_mar/src/webapps/website.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import web
from web.contrib import PyRSS2Gen
import render_website as render
import model
import forms
import logging
from paginator import Paginator, PaginatorSearch, PaginatorPublicacao
from datetime import datetime
from configuration import WEBSITE_URL
from utils import break_string
urls =... | 34.585492 | 115 | 0.625019 |
import web
from web.contrib import PyRSS2Gen
import render_website as render
import model
import forms
import logging
from paginator import Paginator, PaginatorSearch, PaginatorPublicacao
from datetime import datetime
from configuration import WEBSITE_URL
from utils import break_string
urls = (
'', 'Index',
'/'... | true | true |
f720fd62a5d1381a1365405380ceac93188e3ca0 | 11,640 | py | Python | clients/client/python/ory_client/model/project_revisions.py | ALTELMA/sdk | a04d56edd0431382dda8a9d10229b8479174aa8e | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/project_revisions.py | ALTELMA/sdk | a04d56edd0431382dda8a9d10229b8479174aa8e | [
"Apache-2.0"
] | null | null | null | clients/client/python/ory_client/model/project_revisions.py | ALTELMA/sdk | a04d56edd0431382dda8a9d10229b8479174aa8e | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.93
Contact: support@ory.sh
Generated by: htt... | 40.842105 | 194 | 0.563574 |
import re
import sys
from ory_client.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,
OpenA... | true | true |
f720fe1037c1d4bf5fae4c4643726fa3e26e29a5 | 2,400 | py | Python | rlkit/core/eval_util.py | ethanabrooks/oyster | 08b758b15ca19c50c43a137cba733b79be55654a | [
"MIT"
] | null | null | null | rlkit/core/eval_util.py | ethanabrooks/oyster | 08b758b15ca19c50c43a137cba733b79be55654a | [
"MIT"
] | null | null | null | rlkit/core/eval_util.py | ethanabrooks/oyster | 08b758b15ca19c50c43a137cba733b79be55654a | [
"MIT"
] | null | null | null | """
Common evaluation utilities.
"""
from collections import OrderedDict
from numbers import Number
import os
import numpy as np
def dprint(*args):
# hacky, but will do for now
if int(os.environ["DEBUG"]) == 1:
print(args)
def get_generic_path_information(paths, stat_prefix=""):
"""
Get an ... | 28.235294 | 85 | 0.635 |
from collections import OrderedDict
from numbers import Number
import os
import numpy as np
def dprint(*args):
if int(os.environ["DEBUG"]) == 1:
print(args)
def get_generic_path_information(paths, stat_prefix=""):
statistics = OrderedDict()
returns = [sum(path["rewards"]) for path in paths... | true | true |
f720ff6a241c7d87d8b54a04ab91ce4d35a8ee45 | 55,439 | py | Python | dlpy/timeseries.py | qzlvyh/sassoftware-python-dlpy | 9bf8cc4ffd5ae235e377004644ef70398431e09c | [
"Apache-2.0"
] | 1 | 2019-04-02T14:36:55.000Z | 2019-04-02T14:36:55.000Z | dlpy/timeseries.py | qzlvyh/sassoftware-python-dlpy | 9bf8cc4ffd5ae235e377004644ef70398431e09c | [
"Apache-2.0"
] | null | null | null | dlpy/timeseries.py | qzlvyh/sassoftware-python-dlpy | 9bf8cc4ffd5ae235e377004644ef70398431e09c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 41.840755 | 116 | 0.570771 |
from __future__ import (print_function, division, absolute_import, unicode_literals)
from swat.cas.table import CASTable
from .utils import random_name, get_cas_host_type, char_to_double, int_to_double
from dlpy.utils import DLPyError
from swat.cas import datamsghandlers
import numpy as np
import pan... | true | true |
f720ffac3d7e28046fdffc89dc587da7ce834892 | 9,152 | py | Python | tests/utils_tests/test_functional.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | tests/utils_tests/test_functional.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | tests/utils_tests/test_functional.py | Lord-Elrond/django | 178109c1734ccc16386c3e3cbae1465c7a1b8ed8 | [
"BSD-3-Clause",
"0BSD"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | from unittest import mock
from django.test import SimpleTestCase
from django.test.utils import ignore_warnings
from django.utils.deprecation import RemovedInDjango50Warning
from django.utils.functional import cached_property, classproperty, lazy
class FunctionalTests(SimpleTestCase):
def test_lazy(self):
... | 31.777778 | 89 | 0.573864 | from unittest import mock
from django.test import SimpleTestCase
from django.test.utils import ignore_warnings
from django.utils.deprecation import RemovedInDjango50Warning
from django.utils.functional import cached_property, classproperty, lazy
class FunctionalTests(SimpleTestCase):
def test_lazy(self):
... | true | true |
f7210110e7084f60ae5367f63c7dbd932a3b569e | 4,446 | py | Python | examples/batch_mode/14-burning_ship-deeper_DEM.py | GBillotey/Fractalshades | e100b12db031f016bf1a8a1f4fad9ca1c64a0302 | [
"MIT"
] | null | null | null | examples/batch_mode/14-burning_ship-deeper_DEM.py | GBillotey/Fractalshades | e100b12db031f016bf1a8a1f4fad9ca1c64a0302 | [
"MIT"
] | 1 | 2021-11-01T14:55:57.000Z | 2021-11-01T14:55:57.000Z | examples/batch_mode/14-burning_ship-deeper_DEM.py | GBillotey/Fractalshades | e100b12db031f016bf1a8a1f4fad9ca1c64a0302 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
============================
14 - Burning ship deeper DEM
============================
Plotting of a distance estimation for the Burning ship (power-2).
This zoom is deeper, featuring a miniship at 1.e-101
Reference:
`fractalshades.models.Perturbation_burning_ship`
"""
import os
import nu... | 27.7875 | 123 | 0.639226 |
import os
import numpy as np
import fractalshades as fs
import fractalshades.models as fsm
import fractalshades.colors as fscolors
from fractalshades.postproc import (
Postproc_batch,
Continuous_iter_pp,
DEM_normal_pp,
DEM_pp,
Raw_pp,
)
from fractalshades.colors.layers import (
Color_layer,
... | true | true |
f721011b4e470373ce2d983fc11e2f51ebcc9318 | 2,154 | py | Python | mean_var_std.py | jmacdonald2010/mean-variance-standard-deviation-calculator | badae42c099081610fd55ea5a788867c352da6c0 | [
"MIT"
] | null | null | null | mean_var_std.py | jmacdonald2010/mean-variance-standard-deviation-calculator | badae42c099081610fd55ea5a788867c352da6c0 | [
"MIT"
] | null | null | null | mean_var_std.py | jmacdonald2010/mean-variance-standard-deviation-calculator | badae42c099081610fd55ea5a788867c352da6c0 | [
"MIT"
] | null | null | null | import numpy as np
def calculate(list):
if len(list) != 9:
raise ValueError('List must contain nine numbers.')
input_array = np.array([[list[0], list[1], list[2]], [list[3], list[4], list[5]], [list[6], list[7], list[8]]])
calculations = dict()
print(input_array)
# calc mean
c_mean = n... | 35.9 | 162 | 0.633705 | import numpy as np
def calculate(list):
if len(list) != 9:
raise ValueError('List must contain nine numbers.')
input_array = np.array([[list[0], list[1], list[2]], [list[3], list[4], list[5]], [list[6], list[7], list[8]]])
calculations = dict()
print(input_array)
c_mean = np.mean(inpu... | true | true |
f7210156036c5232eb883f6a274abc49ea56fb3e | 154 | py | Python | src/wsgi.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-01-16T23:36:10.000Z | 2020-01-16T23:36:10.000Z | src/wsgi.py | mononobi/imovie-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 24 | 2020-06-08T18:27:04.000Z | 2021-06-06T12:01:39.000Z | src/wsgi.py | mononobi/charma-server | ed90f5ec0b5ff3996232d5fe49a4f77f96d82ced | [
"BSD-3-Clause"
] | 1 | 2020-12-20T05:29:04.000Z | 2020-12-20T05:29:04.000Z | # -*- coding: utf-8 -*-
"""
wsgi module.
"""
from charma import CharmaApplication
app = CharmaApplication()
if __name__ == '__main__':
app.run()
| 11 | 36 | 0.62987 |
from charma import CharmaApplication
app = CharmaApplication()
if __name__ == '__main__':
app.run()
| true | true |
f721018bc2069beaa9e6763bc79cdfced921521d | 667 | py | Python | examples/pipelayer_microservice/src/service/api/__init__.py | greater-than/PipeLayer | 569f43b65992f8a32079835585b864d5fe0bb251 | [
"BSD-2-Clause"
] | 61 | 2021-02-03T02:54:18.000Z | 2021-12-26T11:38:51.000Z | examples/pipelayer_microservice/src/service/api/__init__.py | greater-than/PipeLayer | 569f43b65992f8a32079835585b864d5fe0bb251 | [
"BSD-2-Clause"
] | 1 | 2021-02-16T13:58:33.000Z | 2021-02-18T12:56:32.000Z | examples/pipelayer_microservice/src/service/api/__init__.py | greater-than/PipeLayer | 569f43b65992f8a32079835585b864d5fe0bb251 | [
"BSD-2-Clause"
] | null | null | null | from logging import Logger
from typing import cast
from service.exception import ResponseException
def handle_exception(e: Exception, log: Logger = Logger("Error Logger")) -> dict:
log.error("Error")
if isinstance(e, [ResponseException]):
e: ResponseException = cast(ResponseException, e)
log.... | 30.318182 | 81 | 0.626687 | from logging import Logger
from typing import cast
from service.exception import ResponseException
def handle_exception(e: Exception, log: Logger = Logger("Error Logger")) -> dict:
log.error("Error")
if isinstance(e, [ResponseException]):
e: ResponseException = cast(ResponseException, e)
log.... | true | true |
f72101a1cd9b75e2e0ec0b24d9f3753fae5048d3 | 70,980 | py | Python | azure-devops/azure/devops/v5_1/work/work_client.py | imafidon2020/azure-devops-python-api | ea9075f0c54dbc10115a23a8b7ad34feacbbdc14 | [
"MIT"
] | 248 | 2019-05-10T14:20:24.000Z | 2022-03-29T12:17:27.000Z | azure-devops/azure/devops/v5_1/work/work_client.py | AzureMentor/azure-devops-python-api | 3838e91d662dba1f77b43ad560ca23c1cb7e84e8 | [
"MIT"
] | 147 | 2019-05-08T14:20:49.000Z | 2022-03-28T19:36:21.000Z | azure-devops/azure/devops/v5_1/work/work_client.py | AzureMentor/azure-devops-python-api | 3838e91d662dba1f77b43ad560ca23c1cb7e84e8 | [
"MIT"
] | 121 | 2019-05-08T06:24:39.000Z | 2022-03-01T12:58:02.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | 47.256991 | 250 | 0.591181 |
from msrest import Serializer, Deserializer
from ...client import Client
from . import models
class WorkClient(Client):
"""Work
:param str base_url: Service URL
:param Authentication creds: Authenticated credentials.
"""
def __init__(self, base_url=None, creds=None):
super(WorkCl... | false | true |
f7210264f1cece9dc5803d333f7cdf0b48ec3e1d | 68,178 | py | Python | pymc3/tests/test_distributions.py | semohr/pymc3 | 198d13e2ed6f32b33fd8f4b591a47dc8dd8fe2df | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_distributions.py | semohr/pymc3 | 198d13e2ed6f32b33fd8f4b591a47dc8dd8fe2df | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_distributions.py | semohr/pymc3 | 198d13e2ed6f32b33fd8f4b591a47dc8dd8fe2df | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# 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.46815 | 160 | 0.551014 |
import itertools
import sys
from .helpers import SeededTest, select_by_precision
from ..vartypes import continuous_types
from ..model import Model, Point, Deterministic
from ..blocking import DictToVarBijection
from ..distributions import (
DensityDist,
Categorical,
Multinomial,
VonMises,... | true | true |
f7210284a779e313ff51ffedd4c249f391eb87fd | 121 | py | Python | data_prepare.py | yangsgit/Spam_Filter | 7003101f35d72bcdee50763addef25901bc1fdf4 | [
"MIT"
] | 1 | 2019-02-08T18:26:39.000Z | 2019-02-08T18:26:39.000Z | data_prepare.py | yangsgit/Spam_Filter | 7003101f35d72bcdee50763addef25901bc1fdf4 | [
"MIT"
] | null | null | null | data_prepare.py | yangsgit/Spam_Filter | 7003101f35d72bcdee50763addef25901bc1fdf4 | [
"MIT"
] | null | null | null | # 1 read file
# 2 clean data
# 3 tokenize
# 4 eleminate stop words
# 5 calculate tfidf matrix
def read_file(file_path):
| 15.125 | 26 | 0.735537 |
def read_file(file_path):
| false | true |
f72103e31fd52dd21e230b7d278470e15c333340 | 4,056 | py | Python | volttron/platform/agent/math_utils.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 73 | 2017-07-11T21:46:41.000Z | 2022-03-11T03:35:25.000Z | volttron/platform/agent/math_utils.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 19 | 2017-10-10T22:06:15.000Z | 2022-03-28T21:03:33.000Z | volttron/platform/agent/math_utils.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 36 | 2017-06-24T00:17:03.000Z | 2022-03-31T13:58:36.000Z | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2015, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistri... | 41.387755 | 72 | 0.747288 |
def mean(data):
n = len(data)
if n < 1:
raise ValueError('mean requires at least one data point')
return sum(data)/n
def _ss(data):
c = mean(data)
ss = sum((x-c)**2 for x in data)
return ss
def pstdev(data):
n = len(data)
... | true | true |
f721048f673e5d2667f9c29872d43caa5b8b8721 | 25,162 | py | Python | blender/.blender/scripts/ac3d_export.py | visnz/sketchfab_download | 976f667d5c2c2864b2bad65aceac0dab5ce51b74 | [
"Apache-2.0"
] | 41 | 2021-02-18T05:56:26.000Z | 2021-12-06T07:58:15.000Z | blender/.blender/scripts/ac3d_export.py | visnz/sketchfab_download | 976f667d5c2c2864b2bad65aceac0dab5ce51b74 | [
"Apache-2.0"
] | 19 | 2021-02-18T05:59:03.000Z | 2022-01-13T01:00:52.000Z | blender/.blender/scripts/ac3d_export.py | visnz/sketchfab_download | 976f667d5c2c2864b2bad65aceac0dab5ce51b74 | [
"Apache-2.0"
] | 18 | 2021-02-22T13:32:56.000Z | 2022-01-22T12:38:29.000Z | #!BPY
""" Registration info for Blender menus:
Name: 'AC3D (.ac)...'
Blender: 243
Group: 'Export'
Tip: 'Export selected meshes to AC3D (.ac) format'
"""
__author__ = "Willian P. Germano"
__url__ = ("blender", "blenderartists.org", "AC3D's homepage, http://www.ac3d.org",
"PLib 3d gaming lib, http://plib.sf.net")
__ve... | 30.352232 | 228 | 0.657499 |
""" Registration info for Blender menus:
Name: 'AC3D (.ac)...'
Blender: 243
Group: 'Export'
Tip: 'Export selected meshes to AC3D (.ac) format'
"""
__author__ = "Willian P. Germano"
__url__ = ("blender", "blenderartists.org", "AC3D's homepage, http://www.ac3d.org",
"PLib 3d gaming lib, http://plib.sf.net")
__version... | false | true |
f721053f1c2b0366de64431ea3ca1a8eaac1c75f | 9,874 | py | Python | tests/conftest.py | dobixu/elastalert2 | 2d403918514d7c6e8aa24658c4c1f683dd143d89 | [
"Apache-2.0"
] | 250 | 2021-04-24T18:06:30.000Z | 2022-03-31T04:37:47.000Z | tests/conftest.py | dobixu/elastalert2 | 2d403918514d7c6e8aa24658c4c1f683dd143d89 | [
"Apache-2.0"
] | 129 | 2021-04-24T17:09:50.000Z | 2022-03-29T08:52:14.000Z | tests/conftest.py | dobixu/elastalert2 | 2d403918514d7c6e8aa24658c4c1f683dd143d89 | [
"Apache-2.0"
] | 128 | 2021-04-25T15:20:34.000Z | 2022-03-31T04:37:49.000Z | # -*- coding: utf-8 -*-
import datetime
import logging
import os
from unittest import mock
import pytest
import elastalert.elastalert
import elastalert.util
from elastalert.util import dt_to_ts
from elastalert.util import ts_to_dt
writeback_index = 'wb'
def pytest_addoption(parser):
parser.addoption(
"... | 38.570313 | 110 | 0.623962 |
import datetime
import logging
import os
from unittest import mock
import pytest
import elastalert.elastalert
import elastalert.util
from elastalert.util import dt_to_ts
from elastalert.util import ts_to_dt
writeback_index = 'wb'
def pytest_addoption(parser):
parser.addoption(
"--runelasticsearch", ac... | true | true |
f721054ced7239cd366b9a4117dc04473f5453e9 | 310 | py | Python | allauth/app_settings.py | tobiasgoecke/django-allauth | 5e80865e521a6ec7b4e0bf4aa62ba470a8376e28 | [
"MIT"
] | 2 | 2016-05-24T21:13:32.000Z | 2017-12-27T13:43:26.000Z | allauth/app_settings.py | tobiasgoecke/django-allauth | 5e80865e521a6ec7b4e0bf4aa62ba470a8376e28 | [
"MIT"
] | null | null | null | allauth/app_settings.py | tobiasgoecke/django-allauth | 5e80865e521a6ec7b4e0bf4aa62ba470a8376e28 | [
"MIT"
] | null | null | null | from django.conf import settings
SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS
LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
REGISTRATION_OPEN = getattr(settings, 'REGISTRATION_OPEN', 'True')
| 25.833333 | 74 | 0.790323 | from django.conf import settings
SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS
LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
REGISTRATION_OPEN = getattr(settings, 'REGISTRATION_OPEN', 'True')
| true | true |
f721060bb454c8f7e5e8d09071be951a7eff3765 | 13,013 | py | Python | tests/p2p/discv5/test_enr.py | AndreMiras/trinity | 6c20e2b63a698d345c282db8ab0cd426f4329ff5 | [
"MIT"
] | null | null | null | tests/p2p/discv5/test_enr.py | AndreMiras/trinity | 6c20e2b63a698d345c282db8ab0cd426f4329ff5 | [
"MIT"
] | null | null | null | tests/p2p/discv5/test_enr.py | AndreMiras/trinity | 6c20e2b63a698d345c282db8ab0cd426f4329ff5 | [
"MIT"
] | null | null | null | import base64
import pytest
import rlp
from eth_utils import (
decode_hex,
to_bytes,
ValidationError,
)
from eth_utils.toolz import (
assoc,
assoc_in,
)
from p2p.discv5.enr import (
ENR,
ENRSedes,
UnsignedENR,
)
from p2p.discv5.identity_schemes import (
IdentityScheme,
V4Iden... | 31.508475 | 99 | 0.683394 | import base64
import pytest
import rlp
from eth_utils import (
decode_hex,
to_bytes,
ValidationError,
)
from eth_utils.toolz import (
assoc,
assoc_in,
)
from p2p.discv5.enr import (
ENR,
ENRSedes,
UnsignedENR,
)
from p2p.discv5.identity_schemes import (
IdentityScheme,
V4Iden... | true | true |
f72107e0ab86bdefce931d0993f38f0d3db29c26 | 12,483 | py | Python | mypy/test/testpep561.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | 1 | 2019-06-15T08:26:28.000Z | 2019-06-15T08:26:28.000Z | mypy/test/testpep561.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | 1 | 2021-03-31T20:22:11.000Z | 2021-03-31T20:22:11.000Z | mypy/test/testpep561.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | null | null | null | from contextlib import contextmanager
from enum import Enum
import os
import sys
import tempfile
from typing import Tuple, List, Generator, Optional
from unittest import TestCase, main
import mypy.api
from mypy.modulefinder import get_site_packages_dirs
from mypy.test.config import package_path
from mypy.test.helpers ... | 37.827273 | 98 | 0.599295 | from contextlib import contextmanager
from enum import Enum
import os
import sys
import tempfile
from typing import Tuple, List, Generator, Optional
from unittest import TestCase, main
import mypy.api
from mypy.modulefinder import get_site_packages_dirs
from mypy.test.config import package_path
from mypy.test.helpers ... | true | true |
f72108b9bfb35d1a7e2ad22f95c5ce9bc663f987 | 14,680 | py | Python | scripts/cluster/agent.py | nobusugi246/microk8s | 797720e2d1e74030fc3d8df5d291469c6082aaac | [
"Apache-2.0"
] | null | null | null | scripts/cluster/agent.py | nobusugi246/microk8s | 797720e2d1e74030fc3d8df5d291469c6082aaac | [
"Apache-2.0"
] | null | null | null | scripts/cluster/agent.py | nobusugi246/microk8s | 797720e2d1e74030fc3d8df5d291469c6082aaac | [
"Apache-2.0"
] | null | null | null | #!flask/bin/python
import getopt
import json
import os
import shutil
import socket
import string
import random
import subprocess
import sys
from .common.utils import try_set_file_permissions
from flask import Flask, jsonify, request, abort, Response
app = Flask(__name__)
CLUSTER_API="cluster/api/v1.0"
snapdata_path ... | 32.767857 | 119 | 0.611512 |
import getopt
import json
import os
import shutil
import socket
import string
import random
import subprocess
import sys
from .common.utils import try_set_file_permissions
from flask import Flask, jsonify, request, abort, Response
app = Flask(__name__)
CLUSTER_API="cluster/api/v1.0"
snapdata_path = os.environ.get('... | true | true |
f721099fd7f552499a35dce11281e52eec0ef465 | 887 | py | Python | OpenCV/Glyph/fontReplacePixel.py | GaryMK/Machine-Learning | 0eb89ed4c6ea712f518741fdcc63f1b2109b4212 | [
"MIT"
] | 1 | 2021-03-12T07:46:00.000Z | 2021-03-12T07:46:00.000Z | OpenCV/Glyph/fontReplacePixel.py | GaryMK/Kaggle | 0eb89ed4c6ea712f518741fdcc63f1b2109b4212 | [
"MIT"
] | null | null | null | OpenCV/Glyph/fontReplacePixel.py | GaryMK/Kaggle | 0eb89ed4c6ea712f518741fdcc63f1b2109b4212 | [
"MIT"
] | null | null | null | # @author: GaryMK
# @EMAIL: chenxingmk@gmail.com
# @Date: 2021/2/14 0:28
# @Version: 1.0
# @Description:
from PIL import Image, ImageDraw, ImageFont
import cv2
import os
def draw(pic):
img = cv2.imread('source/' + pic)
img = img[:, :, (2, 1, 0)]
blank = Image.new("RGB", [len(img[0]), len(img)], "whit... | 25.342857 | 91 | 0.563698 |
from PIL import Image, ImageDraw, ImageFont
import cv2
import os
def draw(pic):
img = cv2.imread('source/' + pic)
img = img[:, :, (2, 1, 0)]
blank = Image.new("RGB", [len(img[0]), len(img)], "white")
drawObj = ImageDraw.Draw(blank)
n = 10
font = ImageFont.truetype('C:/Windows/Fonts/Mic... | true | true |
f7210a163a4280e095d1c9a4bc619202c8d534a1 | 29 | py | Python | nlpblock/model/__init__.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | 3 | 2019-02-27T13:41:26.000Z | 2021-05-13T07:02:39.000Z | nlpblock/model/__init__.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | null | null | null | nlpblock/model/__init__.py | graykode/nlpblock | d7cd9e6d7a0ee401b8fecdbbf3a0ac60bdb3c0d7 | [
"MIT"
] | 3 | 2019-03-02T02:19:46.000Z | 2021-10-03T18:46:52.000Z | from nlpblock.model import *
| 14.5 | 28 | 0.793103 | from nlpblock.model import *
| true | true |
f7210a7be7a7a9686e849af8805af4b5236ca87c | 1,558 | py | Python | Code/finance.py | Naghipourfar/TraderBot | 2604c9df7af7394dfab6a54ea9a65a1b0df6a0ce | [
"MIT"
] | 3 | 2019-02-06T09:45:39.000Z | 2022-01-15T04:48:07.000Z | Code/finance.py | Naghipourfar/TraderBot | 2604c9df7af7394dfab6a54ea9a65a1b0df6a0ce | [
"MIT"
] | null | null | null | Code/finance.py | Naghipourfar/TraderBot | 2604c9df7af7394dfab6a54ea9a65a1b0df6a0ce | [
"MIT"
] | 1 | 2020-01-07T05:20:24.000Z | 2020-01-07T05:20:24.000Z | import numpy as np
import pandas as pd
from pandas_datareader import data
import tensorflow as tf
import matplotlib.pyplot as plt
import keras
from keras.layers import Input, Dense, Dropout, BatchNormalization
from keras.models import Model
from keras.callbacks import History, CSVLogger
"""
Created by Mohsen Nag... | 28.327273 | 72 | 0.734275 | import numpy as np
import pandas as pd
from pandas_datareader import data
import tensorflow as tf
import matplotlib.pyplot as plt
import keras
from keras.layers import Input, Dense, Dropout, BatchNormalization
from keras.models import Model
from keras.callbacks import History, CSVLogger
tickers = ['AAPL', 'MSFT', '... | true | true |
f7210a7f9de0f160b00a0a52aaf0e082c37d647d | 1,685 | py | Python | lib/lib_apscheduler.py | ZhaoUncle/skstack | 9e00305f50fdd60125ec37884247b94b70a9020c | [
"Apache-2.0"
] | null | null | null | lib/lib_apscheduler.py | ZhaoUncle/skstack | 9e00305f50fdd60125ec37884247b94b70a9020c | [
"Apache-2.0"
] | null | null | null | lib/lib_apscheduler.py | ZhaoUncle/skstack | 9e00305f50fdd60125ec37884247b94b70a9020c | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2018年6月19日 @author: encodingl
'''
import time
import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.schedulers.background import BackgroundScheduler
def job1(f):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.lo... | 29.051724 | 130 | 0.645697 |
import time
import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.schedulers.background import BackgroundScheduler
def job1(f):
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), f)
def job2(args1, args2, f):
print(f, args1, args2)
def job3(*... | true | true |
f7210b036da2023fc30a4f620fdbe6743b369a69 | 4,058 | py | Python | movienightbot/db/models.py | squirrelo/MovieNightBot | 53fad77d533f13587d47d64fe7583db55529184a | [
"WTFPL"
] | 3 | 2020-02-22T14:22:21.000Z | 2021-02-04T19:44:38.000Z | movienightbot/db/models.py | squirrelo/MovieNightBot | 53fad77d533f13587d47d64fe7583db55529184a | [
"WTFPL"
] | 42 | 2020-02-10T03:42:29.000Z | 2022-02-12T23:43:43.000Z | movienightbot/db/models.py | squirrelo/MovieNightBot | 53fad77d533f13587d47d64fe7583db55529184a | [
"WTFPL"
] | 3 | 2020-02-14T23:22:24.000Z | 2020-06-06T21:00:14.000Z | import datetime
import peewee as pw
from . import BaseModel
class Server(BaseModel):
id = pw.IntegerField(primary_key=True)
channel = pw.IntegerField(null=False)
movie_time = pw.TimeField(null=False, formats="%H:%M", default="12:00")
admin_role = pw.TextField(null=False, default="Movie Master")
t... | 32.99187 | 116 | 0.673238 | import datetime
import peewee as pw
from . import BaseModel
class Server(BaseModel):
id = pw.IntegerField(primary_key=True)
channel = pw.IntegerField(null=False)
movie_time = pw.TimeField(null=False, formats="%H:%M", default="12:00")
admin_role = pw.TextField(null=False, default="Movie Master")
t... | true | true |
f7210b6d933a1774a42b9590a91353ac70a354f7 | 5,252 | py | Python | euler/large_sum.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | euler/large_sum.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | euler/large_sum.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | example = '''
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
... | 48.62963 | 53 | 0.967822 | example = '''
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
... | true | true |
f7210bd42ee9a00a5539402b91e5c99cc41cade9 | 2,341 | py | Python | examples/dfp/v201505/user_team_association_service/get_user_team_associations_for_user.py | wbrp/googleads-python-lib | c0f8ce6c4acfe88ce8f913a4f0e0e92b548e1022 | [
"Apache-2.0"
] | 1 | 2020-05-23T11:32:32.000Z | 2020-05-23T11:32:32.000Z | examples/dfp/v201505/user_team_association_service/get_user_team_associations_for_user.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201505/user_team_association_service/get_user_team_associations_for_user.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | 2 | 2018-04-20T02:16:33.000Z | 2020-11-12T20:58:54.000Z | #!/usr/bin/python
#
# Copyright 2015 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 b... | 32.068493 | 80 | 0.706963 |
"""This example gets all user team associations for a single user.
To determine which users exist, run get_all_users.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see t... | false | true |
f7210c49de22ec515aedef5c7f5415db79dc84ea | 21,828 | py | Python | recipes/openscenegraph/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 2 | 2021-08-12T06:17:58.000Z | 2021-09-07T23:12:25.000Z | recipes/openscenegraph/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 9 | 2020-01-21T08:27:51.000Z | 2021-01-23T19:21:46.000Z | recipes/openscenegraph/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 2 | 2021-05-12T10:37:57.000Z | 2021-12-15T13:38:16.000Z | from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.29.1"
class OpenSceneGraphConanFile(ConanFile):
name = "openscenegraph"
description = "OpenSceneGraph is an open source high performance 3D graphics toolkit"
topics = ("o... | 40.8 | 189 | 0.624748 | from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.29.1"
class OpenSceneGraphConanFile(ConanFile):
name = "openscenegraph"
description = "OpenSceneGraph is an open source high performance 3D graphics toolkit"
topics = ("o... | true | true |
f7210d73ebb7dc89db96399282088b5d3bdb983b | 5,049 | py | Python | assignments2016/assignment1/cs231n/classifiers/linear_svm.py | janlukasschroeder/Stanford-cs231n | 0502fad608971f0ae4f44c5e5fd8cc062ddfc1f1 | [
"MIT"
] | null | null | null | assignments2016/assignment1/cs231n/classifiers/linear_svm.py | janlukasschroeder/Stanford-cs231n | 0502fad608971f0ae4f44c5e5fd8cc062ddfc1f1 | [
"MIT"
] | null | null | null | assignments2016/assignment1/cs231n/classifiers/linear_svm.py | janlukasschroeder/Stanford-cs231n | 0502fad608971f0ae4f44c5e5fd8cc062ddfc1f1 | [
"MIT"
] | null | null | null | import numpy as np
from random import shuffle
def svm_loss_naive(W, X, y, reg):
"""
Structured SVM loss function, naive implementation (with loops).
Inputs have dimension D, there are C classes, and we operate on minibatches
of N examples.
Inputs:
- W: A numpy array of shape (D, C) containing weights.
... | 35.307692 | 86 | 0.465241 | import numpy as np
from random import shuffle
def svm_loss_naive(W, X, y, reg):
"""
Structured SVM loss function, naive implementation (with loops).
Inputs have dimension D, there are C classes, and we operate on minibatches
of N examples.
Inputs:
- W: A numpy array of shape (D, C) containing weights.
... | false | true |
f7210dc85edd4d0b6ad091c50f23892394528a1e | 1,558 | py | Python | examples/aws_lambda/aws_lambda_oauth.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | 1 | 2021-05-02T16:06:44.000Z | 2021-05-02T16:06:44.000Z | examples/aws_lambda/aws_lambda_oauth.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | 1 | 2021-02-23T21:05:57.000Z | 2021-02-23T21:05:57.000Z | examples/aws_lambda/aws_lambda_oauth.py | korymath/bolt-python | 67e0286d756ba92510315d044303f43b03380b52 | [
"MIT"
] | null | null | null | # ------------------------------------------------
# instead of slack_bolt in requirements.txt
import sys
sys.path.insert(1, "vendor")
# ------------------------------------------------
import logging
from slack_bolt import App
from slack_bolt.adapter.aws_lambda import SlackRequestHandler
from slack_bolt.adapter.aws... | 29.396226 | 96 | 0.727856 |
import sys
sys.path.insert(1, "vendor")
import logging
from slack_bolt import App
from slack_bolt.adapter.aws_lambda import SlackRequestHandler
from slack_bolt.adapter.aws_lambda.lambda_s3_oauth_flow import LambdaS3OAuthFlow
app = App(process_before_response=True, oauth_flow=LambdaS3OAuthFlow(),)
@app.event("... | true | true |
f7210e74f4ea154ad8e0c98314be558c787c9440 | 483 | py | Python | app/settings.py | rchapman83/sticks-clothing | dfdb5283b00c9209f854648e50f30140a0bb3004 | [
"MIT"
] | null | null | null | app/settings.py | rchapman83/sticks-clothing | dfdb5283b00c9209f854648e50f30140a0bb3004 | [
"MIT"
] | null | null | null | app/settings.py | rchapman83/sticks-clothing | dfdb5283b00c9209f854648e50f30140a0bb3004 | [
"MIT"
] | null | null | null | # -*- settings:utf-8 -*-
# Flask settings
import logging
import os
proj_name = os.environ.get('PROJECT_NAME')
debug_mode = os.environ.get('FLASK_DEBUG')
secret_code = os.environ.get('FLASK_SECRET')
DEBUG = debug_mode
TESTING = False
USE_X_SENDFILE = False
CSRF_ENABLED = True
SECRET_KEY = secret_code
# LOGGING
LO... | 21.954545 | 55 | 0.730849 |
import logging
import os
proj_name = os.environ.get('PROJECT_NAME')
debug_mode = os.environ.get('FLASK_DEBUG')
secret_code = os.environ.get('FLASK_SECRET')
DEBUG = debug_mode
TESTING = False
USE_X_SENDFILE = False
CSRF_ENABLED = True
SECRET_KEY = secret_code
LOGGER_NAME = '%s_log' % proj_name
LOG_FILENAME = '/... | true | true |
f7210f83b40555129d292b05eb3bd12a490ff744 | 1,857 | py | Python | samplers.py | linkserendipity/deep-person-reid | 564ccf307336af1b3343fa42c55f9d53df0fa20a | [
"MIT"
] | null | null | null | samplers.py | linkserendipity/deep-person-reid | 564ccf307336af1b3343fa42c55f9d53df0fa20a | [
"MIT"
] | null | null | null | samplers.py | linkserendipity/deep-person-reid | 564ccf307336af1b3343fa42c55f9d53df0fa20a | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data.sampler import Sampler
class RandomIdentitySampler(Sampler):
"""
Randomly sample N identities, then for each identity,
randomly sample K instances, therefore batch size is N*K.... | 37.14 | 113 | 0.662897 | from __future__ import absolute_import
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data.sampler import Sampler
class RandomIdentitySampler(Sampler):
def __init__(self, data_source, num_instances=4):
self.data_source = data_source
self.num_instances = num_in... | true | true |
f7210fbfe983a9e81665dcac17e1a9498a07d28d | 5,545 | py | Python | examples/pwr_run/ml_regression/new_speedup_def/knn_k80.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/ml_regression/new_speedup_def/knn_k80.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/ml_regression/new_speedup_def/knn_k80.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | import pandas
import pdb
from datetime import datetime
import matplotlib
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import glob
import sys
from matplotlib.ticker import MultipleLocator
from scipy.stats import pearsonr, spearmanr
from sklearn import neighbors
from sklearn.... | 31.327684 | 83 | 0.658431 | import pandas
import pdb
from datetime import datetime
import matplotlib
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import glob
import sys
from matplotlib.ticker import MultipleLocator
from scipy.stats import pearsonr, spearmanr
from sklearn import neighbors
from sklearn.... | true | true |
f7210feadbc98c8ee9e14ec28cba851c6e06e25b | 1,367 | py | Python | ssseg/cfgs/fcn/cfgs_voc_resnest101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 411 | 2020-10-22T02:24:57.000Z | 2022-03-31T11:19:17.000Z | ssseg/cfgs/fcn/cfgs_voc_resnest101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 24 | 2020-12-21T03:53:54.000Z | 2022-03-17T06:50:00.000Z | ssseg/cfgs/fcn/cfgs_voc_resnest101os8.py | nianjiuhuiyi/sssegmentation | 4fc12ea7b80fe83170b6d3da0826e53a99ef5325 | [
"MIT"
] | 59 | 2020-12-04T03:40:12.000Z | 2022-03-30T09:12:47.000Z | '''define the config file for voc and resnest101os8'''
import os
from .base_cfg import *
# modify dataset config
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'voc',
'rootdir': os.path.join(os.getcwd(), 'VOCdevkit/VOC2012'),
})
DATASET_CFG['train']['set'] = 'trainaug'
# modify dataloader confi... | 25.314815 | 88 | 0.653255 | import os
from .base_cfg import *
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'voc',
'rootdir': os.path.join(os.getcwd(), 'VOCdevkit/VOC2012'),
})
DATASET_CFG['train']['set'] = 'trainaug'
DATALOADER_CFG = DATALOADER_CFG.copy()
OPTIMIZER_CFG = OPTIMIZER_CFG.copy()
OPTIMIZER_CFG.update(
... | true | true |
f721104366206bc775401b5c4d6634e901a2440d | 495 | py | Python | skype2.py | tullowhurler/GMIT-project-submissions | 5c75d5303bbdf75068b2b874debccf3531c7b80b | [
"Apache-2.0"
] | null | null | null | skype2.py | tullowhurler/GMIT-project-submissions | 5c75d5303bbdf75068b2b874debccf3531c7b80b | [
"Apache-2.0"
] | null | null | null | skype2.py | tullowhurler/GMIT-project-submissions | 5c75d5303bbdf75068b2b874debccf3531c7b80b | [
"Apache-2.0"
] | null | null | null | #Solution 2
#16/3/18 Ian's Solution
def ispalindrome(s): # s is the string
ans = True # thats what will print out
for i in range(len(s)): # loops through s which we put down in print
if s[i] != s[len(s) - 1 -i]: # len s of radar is = 5 as there is 5 digits, we want to get to 0-4 so have to -1, i starts ... | 35.357143 | 137 | 0.640404 |
def ispalindrome(s): # s is the string
ans = True # thats what will print out
for i in range(len(s)): # loops through s which we put down in print
if s[i] != s[len(s) - 1 -i]: # len s of radar is = 5 as there is 5 digits, we want to get to 0-4 so have to -1, i starts at 0 and
ans = False # ... | true | true |
f7211163c547410a5d37c79cba8d58a47a6c46de | 7,205 | py | Python | final-exam/tic_toc_toe_messy.py | Tanner-York-Make-School/SPD-2.31-Testing-and-Architecture | 623537a05cf5a9d50370a414a5056a78f95288eb | [
"MIT"
] | null | null | null | final-exam/tic_toc_toe_messy.py | Tanner-York-Make-School/SPD-2.31-Testing-and-Architecture | 623537a05cf5a9d50370a414a5056a78f95288eb | [
"MIT"
] | null | null | null | final-exam/tic_toc_toe_messy.py | Tanner-York-Make-School/SPD-2.31-Testing-and-Architecture | 623537a05cf5a9d50370a414a5056a78f95288eb | [
"MIT"
] | null | null | null | """
Tic Tac Toe
Reference: With modification from http://inventwithpython.com/chapter10.html.
# TODOs:
# 1. Find all TODO items and see whether you can improve the code.
# In most cases (if not all), you can make them more readable/modular.
# 2. Add/fix function's docstrings
"""
import random
# I didn't refactor ... | 36.025 | 98 | 0.624427 |
import random
# function because that would be drastically changing how the
# code works. Instead of creating a normal tic tac toe game like intended,
# it would add a new feature for creating larger boards, no longer making this
# refactoring but adding a new feature.
def draw_board(board):
# "board" is a list... | true | true |
f721131d0c71c26b6d07fafc53e439f251dd92fe | 18,055 | py | Python | test/test_l2bd_arp_term.py | snergfdio/vppclone | a288f8a1020eb74687eeb0a0a771977ce9b0c01d | [
"Apache-2.0"
] | null | null | null | test/test_l2bd_arp_term.py | snergfdio/vppclone | a288f8a1020eb74687eeb0a0a771977ce9b0c01d | [
"Apache-2.0"
] | 1 | 2021-06-01T23:30:08.000Z | 2021-06-01T23:30:08.000Z | test/test_l2bd_arp_term.py | snergfdio/vppclone | a288f8a1020eb74687eeb0a0a771977ce9b0c01d | [
"Apache-2.0"
] | 1 | 2019-03-11T19:28:31.000Z | 2019-03-11T19:28:31.000Z | #!/usr/bin/env python
""" L2BD ARP term Test """
import unittest
import random
import copy
from socket import AF_INET, AF_INET6
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP
from scapy.layers.inet import IP
from scapy.utils import inet_pton, inet_ntop
from scapy.utils6 import in6_getnsma, in6_g... | 36.92229 | 79 | 0.608419 |
import unittest
import random
import copy
from socket import AF_INET, AF_INET6
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP
from scapy.layers.inet import IP
from scapy.utils import inet_pton, inet_ntop
from scapy.utils6 import in6_getnsma, in6_getnsmac, in6_ptop, in6_islladdr, \
in6_macto... | true | true |
f721134f2cf6dd7f8af453cc2143cd6f38f7cc03 | 1,204 | py | Python | lagom/envs/record_episode_statistics.py | zuoxingdong/lagom | 3b6710804dbc79c6dffb369ac87c68f4055ab6cd | [
"MIT"
] | 383 | 2018-07-11T17:43:10.000Z | 2022-01-24T08:46:23.000Z | lagom/envs/record_episode_statistics.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 90 | 2018-07-11T23:51:45.000Z | 2021-12-16T08:56:42.000Z | lagom/envs/record_episode_statistics.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 32 | 2018-07-12T18:21:03.000Z | 2021-09-15T05:47:48.000Z | import time
from collections import deque
import gym
class RecordEpisodeStatistics(gym.Wrapper):
def __init__(self, env, deque_size=100):
super().__init__(env)
self.t0 = time.perf_counter()
self.episode_return = 0.0
self.episode_horizon = 0
self.return_queue = deque(maxlen... | 34.4 | 79 | 0.599668 | import time
from collections import deque
import gym
class RecordEpisodeStatistics(gym.Wrapper):
def __init__(self, env, deque_size=100):
super().__init__(env)
self.t0 = time.perf_counter()
self.episode_return = 0.0
self.episode_horizon = 0
self.return_queue = deque(maxlen... | true | true |
f721149609f8936e76f673d4273205ed140bf7b3 | 1,608 | py | Python | blog_auth/migrations/0001_initial.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 5 | 2019-08-12T17:56:25.000Z | 2021-08-31T04:36:42.000Z | blog_auth/migrations/0001_initial.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 12 | 2020-02-12T00:38:11.000Z | 2022-03-11T23:50:12.000Z | blog_auth/migrations/0001_initial.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 8 | 2019-06-19T18:54:02.000Z | 2021-01-05T19:31:30.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('... | 43.459459 | 158 | 0.584577 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(v... | true | true |
f721152db9db3827adab40e0750d01f58df5decf | 15,018 | py | Python | cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2015-04-02T21:44:36.000Z | 2016-04-29T21:19:04.000Z | cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2016-04-29T21:45:26.000Z | 2016-05-04T19:41:23.000Z | cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 4 | 2016-01-27T00:25:52.000Z | 2021-03-25T19:54:08.000Z | # (c) Copyright 2016 Brocade Communications Systems 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/LICEN... | 48.289389 | 78 | 0.699827 |
from unittest import mock
from oslo_concurrency import processutils
from cinder import exception
from cinder import test
from cinder.zonemanager.drivers.brocade import (brcd_fc_zone_client_cli
as client_cli)
from cinder.zonemanager.drivers.brocade impor... | true | true |
f72115d189ce1aea3fd459147ab92b50d1a8393a | 807 | py | Python | bluebottle/bluebottle_drf2/renderers.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/bluebottle_drf2/renderers.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/bluebottle_drf2/renderers.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | from rest_framework_json_api.renderers import JSONRenderer
from django.contrib.auth.models import AnonymousUser
class BluebottleJSONAPIRenderer(JSONRenderer):
def get_indent(self, *args, **kwargs):
return 4
@classmethod
def build_json_resource_obj(
cls,
fields,
resource,
... | 26.032258 | 79 | 0.570012 | from rest_framework_json_api.renderers import JSONRenderer
from django.contrib.auth.models import AnonymousUser
class BluebottleJSONAPIRenderer(JSONRenderer):
def get_indent(self, *args, **kwargs):
return 4
@classmethod
def build_json_resource_obj(
cls,
fields,
resource,
... | true | true |
f72116597d007b731f68d9cb1a6c637348e7d55b | 4,912 | py | Python | rclpy/rclpy/context.py | bastinat0r/rclpy | 510b243b2efe9e6b4b20837b7dea8092069cd2d3 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:28:59.000Z | 2021-01-11T06:28:59.000Z | rclpy/rclpy/context.py | bastinat0r/rclpy | 510b243b2efe9e6b4b20837b7dea8092069cd2d3 | [
"Apache-2.0"
] | 1 | 2020-06-28T10:40:59.000Z | 2020-06-28T10:40:59.000Z | rclpy/rclpy/context.py | bastinat0r/rclpy | 510b243b2efe9e6b4b20837b7dea8092069cd2d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Open Source Robotics Foundation, 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... | 39.296 | 97 | 0.667142 |
import sys
import threading
from typing import Callable
from typing import List
from typing import Optional
import weakref
g_logging_configure_lock = threading.Lock()
g_logging_ref_count = 0
class Context:
def __init__(self):
from rclpy.impl.implementation_singleton import rclpy_implement... | true | true |
f72116774894f97836e29f765583285f9e3b5acf | 2,226 | py | Python | .modules/.Infoga/lib/output.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.Infoga/lib/output.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 29 | 2019-04-03T14:52:38.000Z | 2022-03-24T12:33:05.000Z | .modules/.Infoga/lib/output.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 161 | 2018-04-20T15:57:12.000Z | 2022-03-15T19:16:16.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# @name : Infoga - Email Information Gathering
# @url : http://github.com/m4ll0k
# @author : Momo Outaadi (m4ll0k)
from lib.colors import *
def plus(string):print("%s[+]%s %s"%(G%0,E,string))
def warn(string):print("%s[!]%s %s"%(R%0,E,string))
def test(string):pri... | 42.807692 | 120 | 0.600629 |
from lib.colors import *
def plus(string):print("%s[+]%s %s"%(G%0,E,string))
def warn(string):print("%s[!]%s %s"%(R%0,E,string))
def test(string):print("%s[*]%s %s"%(B%0,E,string))
def info(string):print("%s[i]%s %s"%(Y%0,E,string))
def more(string):print(" %s|%s %s"%(W%0,E,string))
def ppwned(data,ver):
if ... | true | true |
f7211689b5c3abfbb49932d88e4323e9e99aec1e | 19,600 | py | Python | pypureclient/flasharray/FA_2_3/models/volume_performance_by_array.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_3/models/volume_performance_by_array.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_3/models/volume_performance_by_array.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 55.211268 | 228 | 0.659847 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_3 import models
class VolumePerformanceByArray(object):
swagger_types = {
'id': 'str',
'name': 'str',
'bytes_per_mirrored_write': 'int',
... | true | true |
f72116c79003469c2b0e2b7eb8a18e69c2918151 | 3,600 | py | Python | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py | ikben/aws-deployment-framework | 9a32492209d35660b9ece66211eb200b64dc0ef9 | [
"Apache-2.0"
] | 1 | 2022-03-24T10:43:53.000Z | 2022-03-24T10:43:53.000Z | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py | thomasmcgannon/aws-deployment-framework | 0723ddf4eaf55888ae780dc48873f0ec4766cfbd | [
"Apache-2.0"
] | null | null | null | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py | thomasmcgannon/aws-deployment-framework | 0723ddf4eaf55888ae780dc48873f0ec4766cfbd | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Step Functions module used throughout the ADF
"""
import json
from time import sleep
from logger import configure_logger
from partition import get_partition
LOGGER = configure_logger(__name__)
class StepF... | 31.578947 | 85 | 0.621944 |
import json
from time import sleep
from logger import configure_logger
from partition import get_partition
LOGGER = configure_logger(__name__)
class StepFunctions:
def __init__(
self,
role,
deployment_account_id,
deployment_account_region,
regions,... | true | true |
f721174bebba042d3b37612296998e084c86fde8 | 918 | py | Python | apps/cli/utils/merge_yaml_sources.py | derekmerck/DIANA | 5553265b8fc822b35848d0966b25b93b99d503fb | [
"MIT"
] | 9 | 2018-03-15T19:10:27.000Z | 2021-03-15T21:01:24.000Z | apps/cli/utils/merge_yaml_sources.py | derekmerck/DIANA | 5553265b8fc822b35848d0966b25b93b99d503fb | [
"MIT"
] | null | null | null | apps/cli/utils/merge_yaml_sources.py | derekmerck/DIANA | 5553265b8fc822b35848d0966b25b93b99d503fb | [
"MIT"
] | 2 | 2018-03-15T19:13:22.000Z | 2018-04-18T16:33:33.000Z | import os, logging
from glob import glob
from pprint import pformat
import yaml
"""
Env var expansion and merge data from:
- input in yaml/json format
- input file or dir of files in yaml/json format
"""
def merge_yaml_sources(data=None, path=None):
result = {}
if data:
data_exp = os.path.expandvars(d... | 27 | 57 | 0.615468 | import os, logging
from glob import glob
from pprint import pformat
import yaml
def merge_yaml_sources(data=None, path=None):
result = {}
if data:
data_exp = os.path.expandvars(data)
result = yaml.safe_load(data_exp)
if os.path.isfile(path):
with open(path) as f:
finpu... | true | true |
f7211765b08d783a5f129616815fe2035703ff38 | 25,215 | py | Python | neutron/agent/l3/router_info.py | markmcclain/neutron | 3108d2dece0501dbb661e2f5a4bb530a199f9fde | [
"Apache-2.0"
] | 3 | 2016-08-07T01:25:54.000Z | 2021-03-01T10:19:14.000Z | neutron/agent/l3/router_info.py | cyysu/neutron_read | 07d1a526d7d44ad0207d27e0ee04f1582541ab89 | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/router_info.py | cyysu/neutron_read | 07d1a526d7d44ad0207d27e0ee04f1582541ab89 | [
"Apache-2.0"
] | 2 | 2016-09-10T13:21:10.000Z | 2016-12-23T01:44:53.000Z | # Copyright (c) 2014 Openstack Foundation
#
# 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 ... | 42.592905 | 79 | 0.599683 |
import netaddr
from oslo_log import log as logging
from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from neutron.agent.linux import ra
from neutron.common import constants as l3_constants
from neutron.common import exceptions... | true | true |
f72117735968d8ce8ce83ea74bae1b18b3eb310b | 284 | py | Python | app/user/urls.py | redoCehT/recipe-app-api | c529f641adf1a7d5af39bf9dc832b68af3348176 | [
"MIT"
] | null | null | null | app/user/urls.py | redoCehT/recipe-app-api | c529f641adf1a7d5af39bf9dc832b68af3348176 | [
"MIT"
] | null | null | null | app/user/urls.py | redoCehT/recipe-app-api | c529f641adf1a7d5af39bf9dc832b68af3348176 | [
"MIT"
] | null | null | null | from django.urls import path
from user import views
app_name = "user"
urlpatterns = [
path("create", views.CreateUserView.as_view(), name="create"),
path("token", views.CreateTokenView.as_view(), name="token"),
path("me", views.ManageUserView.as_view(), name="me"),
]
| 21.846154 | 66 | 0.68662 | from django.urls import path
from user import views
app_name = "user"
urlpatterns = [
path("create", views.CreateUserView.as_view(), name="create"),
path("token", views.CreateTokenView.as_view(), name="token"),
path("me", views.ManageUserView.as_view(), name="me"),
]
| true | true |
f721193ca67842d2930d048034dca9a2d38b368b | 7,370 | py | Python | elodie/media/media.py | phifogg/elodie | 6ca24c10b2b3fa28169976e04a9fd2f524250a44 | [
"Apache-2.0"
] | null | null | null | elodie/media/media.py | phifogg/elodie | 6ca24c10b2b3fa28169976e04a9fd2f524250a44 | [
"Apache-2.0"
] | 1 | 2017-01-07T06:30:43.000Z | 2017-01-19T12:47:07.000Z | elodie/media/media.py | phifogg/elodie | 6ca24c10b2b3fa28169976e04a9fd2f524250a44 | [
"Apache-2.0"
] | null | null | null | """
The media module provides a base :class:`Media` class for media objects that
are tracked by Elodie. The Media class provides some base functionality used
by all the media types, but isn't itself used to represent anything. Its
sub-classes (:class:`~elodie.media.audio.Audio`,
:class:`~elodie.media.photo.Photo`, and ... | 30.081633 | 88 | 0.589281 | from __future__ import print_function
from elodie import constants
from elodie.dependencies import get_exiftool
from elodie.external.pyexiftool import ExifTool
from elodie.media.base import Base
class Media(Base):
__name__ = 'Media'
d_coordinates = {
'latitude': 'latitude_ref',
'longitude... | true | true |
f72119fc9448d568049ba81365d0643f5fc6eaa0 | 7,330 | py | Python | src/satlas2/models/hfsModel.py | woutergins/satlas2 | 51afdc445c8c603372bb26abe19d1eb7bd3f3f24 | [
"MIT"
] | null | null | null | src/satlas2/models/hfsModel.py | woutergins/satlas2 | 51afdc445c8c603372bb26abe19d1eb7bd3f3f24 | [
"MIT"
] | null | null | null | src/satlas2/models/hfsModel.py | woutergins/satlas2 | 51afdc445c8c603372bb26abe19d1eb7bd3f3f24 | [
"MIT"
] | null | null | null | from satlas2.core import Model, Parameter
import numpy as np
from scipy.special import wofz
from sympy.physics.wigner import wigner_6j, wigner_3j
__all__ = ['HFS']
sqrt2 = 2 ** 0.5
sqrt2log2t2 = 2 * np.sqrt(2 * np.log(2))
log2 = np.log(2)
class HFS(Model):
def __init__(self, I, J, A=[0, 0], B=[0, 0], C=[0, 0], ... | 38.783069 | 206 | 0.502456 | from satlas2.core import Model, Parameter
import numpy as np
from scipy.special import wofz
from sympy.physics.wigner import wigner_6j, wigner_3j
__all__ = ['HFS']
sqrt2 = 2 ** 0.5
sqrt2log2t2 = 2 * np.sqrt(2 * np.log(2))
log2 = np.log(2)
class HFS(Model):
def __init__(self, I, J, A=[0, 0], B=[0, 0], C=[0, 0], ... | true | true |
f7211a6c4ae21fd092ed3210d9ed20271e7afe65 | 19,979 | py | Python | collect/TwHistory.py | mcuiteallen/stock | 06c56db6c712ab88fabdc67a8812869ad4180f6f | [
"MIT"
] | null | null | null | collect/TwHistory.py | mcuiteallen/stock | 06c56db6c712ab88fabdc67a8812869ad4180f6f | [
"MIT"
] | null | null | null | collect/TwHistory.py | mcuiteallen/stock | 06c56db6c712ab88fabdc67a8812869ad4180f6f | [
"MIT"
] | null | null | null | import calendar
import math
import pandas as pd
import time
import twstock
import requests
from datetime import datetime, timedelta
from dateutil import relativedelta
from db.Connection import session
from enum import Enum
from model.StockHistory import StockHistory
from sys import float_info
from talib import abstract... | 51.359897 | 207 | 0.569198 | import calendar
import math
import pandas as pd
import time
import twstock
import requests
from datetime import datetime, timedelta
from dateutil import relativedelta
from db.Connection import session
from enum import Enum
from model.StockHistory import StockHistory
from sys import float_info
from talib import abstract... | true | true |
f7211ab5f9fd402c221ac94f5f39ef29a6d25331 | 88,960 | py | Python | pandas/tests/arithmetic/test_datetime64.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | 6 | 2020-09-10T15:03:25.000Z | 2021-04-01T22:48:33.000Z | pandas/tests/arithmetic/test_datetime64.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/arithmetic/test_datetime64.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | 4 | 2020-02-07T05:05:32.000Z | 2020-05-11T06:06:17.000Z | # Arithmetic tests for DataFrame/Series/Index/Array classes that should
# behave identically.
# Specifically for datetime64 and datetime64tz dtypes
from datetime import datetime, timedelta
from itertools import product, starmap
import operator
import warnings
import numpy as np
import pytest
import pytz
from pandas._... | 36.473965 | 88 | 0.584364 |
from datetime import datetime, timedelta
from itertools import product, starmap
import operator
import warnings
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs.conversion import localize_pydatetime
from pandas._libs.tslibs.offsets import shift_months
from pandas.compat.numpy import np_datetim... | true | true |
f7211b62c471429cc135fe0e8292971b94db291e | 1,167 | py | Python | app/database/api/models/resource.py | space-logistics-org/spacenet | fd004437ed7b27dd6dc41a374e1dedfcea92e37d | [
"MIT"
] | 1 | 2022-02-17T18:01:41.000Z | 2022-02-17T18:01:41.000Z | app/database/api/models/resource.py | space-logistics-org/spacenet | fd004437ed7b27dd6dc41a374e1dedfcea92e37d | [
"MIT"
] | 2 | 2021-06-19T19:41:15.000Z | 2021-07-21T17:07:48.000Z | app/database/api/models/resource.py | space-logistics-org/spacenet | fd004437ed7b27dd6dc41a374e1dedfcea92e37d | [
"MIT"
] | 3 | 2021-06-16T16:31:12.000Z | 2022-02-17T18:02:57.000Z | """
This module defines the database schema for resources and resource subclasses.
"""
from sqlalchemy import Column, Integer, String, Float
from ..database import Base
from spacenet.schemas.resource import ResourceType
__all__ = ["Resource", "ResourceType", "ContinuousResource", "DiscreteResource"]
class Resourc... | 25.369565 | 82 | 0.717224 |
from sqlalchemy import Column, Integer, String, Float
from ..database import Base
from spacenet.schemas.resource import ResourceType
__all__ = ["Resource", "ResourceType", "ContinuousResource", "DiscreteResource"]
class Resource(Base):
__tablename__ = "resource"
id = Column(Integer, primary_key=True, ind... | true | true |
f7211bd5305aa8d6dd9cc38d64504cc0312f6ab1 | 812 | py | Python | Latte/ex5.py | Latte-inc/Learn-Python3.6 | f3568cf2f8413f8730c2297bc39ae890bb82d962 | [
"CC0-1.0"
] | 1 | 2021-10-15T05:43:19.000Z | 2021-10-15T05:43:19.000Z | Latte/ex5.py | Latte-inc/Learn-Python3.6 | f3568cf2f8413f8730c2297bc39ae890bb82d962 | [
"CC0-1.0"
] | null | null | null | Latte/ex5.py | Latte-inc/Learn-Python3.6 | f3568cf2f8413f8730c2297bc39ae890bb82d962 | [
"CC0-1.0"
] | 1 | 2022-01-13T10:34:55.000Z | 2022-01-13T10:34:55.000Z | # # This code is learn Python new code, variable format string start!
# Time 2020/05/15 00:44
# fatcat like .....
my_name = 'fatcat'
my_age = 24 #肥猫真的24岁哦!
my_height = 176 #是厘米(CM)哦!
my_weight = 93 #是公斤(Kg)哦!
my_eyes = 'black'
my_teeth = 'white'
my_hair = 'black'
#上述变量被赋予了两种类型 一种是赋予变量数字值,一种是赋予变量字符串。
pr... | 30.074074 | 73 | 0.685961 | 3
my_eyes = 'black'
my_teeth = 'white'
my_hair = 'black'
print(f"Let's talk about {my_name}.")
print(f"He's {my_height} CM.")
print(f"He's {my_weight} kilo.")
print("Actually that's not too heavy.")
print(f"His teeth are usually {my_teeth} depending on the coffee.")
total = my_age + my_height + my_weig... | true | true |
f7211beca92603a62d9cbaad149c7663ec244549 | 881 | py | Python | examples/pylab_examples/contour_corner_mask.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-15T09:40:53.000Z | 2019-04-15T09:40:53.000Z | examples/pylab_examples/contour_corner_mask.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/pylab_examples/contour_corner_mask.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Illustrate the difference between corner_mask=False and corner_mask=True
for masked contour plots.
"""
import matplotlib.pyplot as plt
import numpy as np
# Data to plot.
x, y = np.meshgrid(np.arange(7), np.arange(10))
z = np.sin(0.5*x)*np.cos(0.52*y)
# Mask various z values.
mask = np.zeros_... | 24.472222 | 72 | 0.658343 |
import matplotlib.pyplot as plt
import numpy as np
x, y = np.meshgrid(np.arange(7), np.arange(10))
z = np.sin(0.5*x)*np.cos(0.52*y)
mask = np.zeros_like(z, dtype=np.bool)
mask[2, 3:5] = True
mask[3:5, 4] = True
mask[7, 2] = True
mask[5, 0] = True
mask[0, 6] = True
z = np.ma.array(z, mask=mask)
corner_masks = [Fal... | true | true |
f7211e7c6967282019c097e1107691531485b132 | 847 | py | Python | authors/apps/notify/migrations/0001_initial.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/notify/migrations/0001_initial.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | 46 | 2019-01-08T13:16:41.000Z | 2021-04-30T20:47:08.000Z | authors/apps/notify/migrations/0001_initial.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | 3 | 2019-01-07T08:21:59.000Z | 2019-09-20T06:43:18.000Z | # Generated by Django 2.1.5 on 2019-01-30 03:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 31.37037 | 118 | 0.651712 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f7211e7d3cba1e8c8ec791ea66706c3f0cbcf0a0 | 3,776 | py | Python | search_engine_parser/core/utils.py | justfly50/search-engine-parser | 0418867b3529980d5a4eb71899dec37092fe7df1 | [
"MIT"
] | 276 | 2019-02-01T22:48:46.000Z | 2021-10-17T21:25:13.000Z | search_engine_parser/core/utils.py | justfly50/search-engine-parser | 0418867b3529980d5a4eb71899dec37092fe7df1 | [
"MIT"
] | 95 | 2019-02-03T00:04:11.000Z | 2021-09-22T17:45:56.000Z | search_engine_parser/core/utils.py | justfly50/search-engine-parser | 0418867b3529980d5a4eb71899dec37092fe7df1 | [
"MIT"
] | 74 | 2019-02-02T11:04:17.000Z | 2021-10-09T23:49:25.000Z | import os
import random
import pickle
import hashlib
import aiohttp
from fake_useragent import UserAgent
FILEPATH = os.path.dirname(os.path.abspath(__file__))
# prevent caching
USER_AGENT_LIST = [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0",
"Mozilla/5.0 (Windows NT 10.... | 37.019608 | 101 | 0.598782 | import os
import random
import pickle
import hashlib
import aiohttp
from fake_useragent import UserAgent
FILEPATH = os.path.dirname(os.path.abspath(__file__))
USER_AGENT_LIST = [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) Ap... | true | true |
f7211f5a04fad86d5e96b8e6c5fee8d770e20d1e | 5,324 | py | Python | leddar_ros2/leddar_sensor.py | JulienStanguennec-Leddartech/leddar_ros2 | 15f2674d8e7c472bc56c4be9cfd41f0d8d39c0bf | [
"BSD-3-Clause"
] | null | null | null | leddar_ros2/leddar_sensor.py | JulienStanguennec-Leddartech/leddar_ros2 | 15f2674d8e7c472bc56c4be9cfd41f0d8d39c0bf | [
"BSD-3-Clause"
] | null | null | null | leddar_ros2/leddar_sensor.py | JulienStanguennec-Leddartech/leddar_ros2 | 15f2674d8e7c472bc56c4be9cfd41f0d8d39c0bf | [
"BSD-3-Clause"
] | null | null | null |
import sys
import os
import time
#Import ros2 py
import rclpy
from rclpy.node import Node
#Import messages
import sensor_msgs.msg as sensor_msgs
import std_msgs.msg as std_msgs
#Import parameters (to read parameters)
from rclpy.parameter import Parameter
import numpy as np
import leddar
def point_cloud(points,... | 33.696203 | 150 | 0.655147 |
import sys
import os
import time
import rclpy
from rclpy.node import Node
import sensor_msgs.msg as sensor_msgs
import std_msgs.msg as std_msgs
from rclpy.parameter import Parameter
import numpy as np
import leddar
def point_cloud(points, parent_frame):
ros_dtype = sensor_msgs.PointField.... | true | true |
f7211f913ac30f34f3eb6b9c021cc65dc21ed271 | 3,962 | py | Python | StimRespFlow/DataStruct/WaveData.py | powerfulbean/StellarWave | 877d5113054f391f605c8e39f1a0f60f7bfeeee1 | [
"MIT"
] | 3 | 2020-09-16T06:14:00.000Z | 2021-03-17T00:05:06.000Z | StimRespFlow/DataStruct/WaveData.py | powerfulbean/StellarWave | 877d5113054f391f605c8e39f1a0f60f7bfeeee1 | [
"MIT"
] | null | null | null | StimRespFlow/DataStruct/WaveData.py | powerfulbean/StellarWave | 877d5113054f391f605c8e39f1a0f60f7bfeeee1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 9 23:21:06 2021
@author: ShiningStone
"""
import datetime
import numpy as np
from .Abstract import CWaveData,CTimeStampsGen
class CDateTimeStampsGen(CTimeStampsGen):
def __init__(self,start:datetime.datetime,delta:datetime.timedelta,nLen):
super().__in... | 39.62 | 128 | 0.575719 |
import datetime
import numpy as np
from .Abstract import CWaveData,CTimeStampsGen
class CDateTimeStampsGen(CTimeStampsGen):
def __init__(self,start:datetime.datetime,delta:datetime.timedelta,nLen):
super().__init__(start,delta,nLen)
class CBitalinoWaveData(CWaveData):
def __i... | true | true |
f721210773ad82cd155b9581ac29c5f1c9609d67 | 20,043 | py | Python | conda/models/match_spec.py | abar2day/najran | 3a30636f494275b0f259be7b1875fd0fd7759f20 | [
"BSD-3-Clause"
] | 1 | 2017-06-11T01:32:33.000Z | 2017-06-11T01:32:33.000Z | conda/models/match_spec.py | abar2day/najran | 3a30636f494275b0f259be7b1875fd0fd7759f20 | [
"BSD-3-Clause"
] | null | null | null | conda/models/match_spec.py | abar2day/najran | 3a30636f494275b0f259be7b1875fd0fd7759f20 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from abc import ABCMeta, abstractmethod, abstractproperty
from collections import Mapping
import re
from .channel import Channel, MultiChannel
from .dist import Dist
from .index_record import IndexRecord
from .v... | 32.857377 | 94 | 0.592925 |
from __future__ import absolute_import, division, print_function, unicode_literals
from abc import ABCMeta, abstractmethod, abstractproperty
from collections import Mapping
import re
from .channel import Channel, MultiChannel
from .dist import Dist
from .index_record import IndexRecord
from .version import BuildNumb... | true | true |
f721212419baf5ea18640832b738d3e1f17382a7 | 6,485 | py | Python | tests/integration-tests/cfn_stacks_factory.py | agobeaux/aws-parallelcluster | ec337c6b8341f9b84616b6bbbe8687a0a5f71126 | [
"Apache-2.0"
] | null | null | null | tests/integration-tests/cfn_stacks_factory.py | agobeaux/aws-parallelcluster | ec337c6b8341f9b84616b6bbbe8687a0a5f71126 | [
"Apache-2.0"
] | null | null | null | tests/integration-tests/cfn_stacks_factory.py | agobeaux/aws-parallelcluster | ec337c6b8341f9b84616b6bbbe8687a0a5f71126 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 39.066265 | 119 | 0.626831 |
import logging
import boto3
from botocore.exceptions import ClientError
from retrying import retry
from utils import retrieve_cfn_outputs, retrieve_cfn_resources, set_credentials, unset_credentials
class CfnStack:
def __init__(self, name, region, template, parameters=None):
self.name = name
... | true | true |
f721218a181e524dc4105ce1e8ccda9b8507b1c2 | 3,080 | py | Python | blog/blog/settings.py | zhaotao789/blog | de23e5a29b6aae2fc87829833f3fae256c55f5b3 | [
"MIT"
] | null | null | null | blog/blog/settings.py | zhaotao789/blog | de23e5a29b6aae2fc87829833f3fae256c55f5b3 | [
"MIT"
] | null | null | null | blog/blog/settings.py | zhaotao789/blog | de23e5a29b6aae2fc87829833f3fae256c55f5b3 | [
"MIT"
] | null | null | null | """
Django settings for blog project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Buil... | 25.454545 | 91 | 0.696104 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'd120mv4fw)wcwekzk-r^1w5++9e^q_6qteo4-+n8kk4ei%i5$0'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f72121ecda5066fe0ef9c48035c6f35ba4a47c1b | 400 | py | Python | lino_tera/lib/coachings/choicelists.py | khchine5/tera | dd85aaefc2392fa831bcee7c258d37038e32aeb7 | [
"BSD-2-Clause"
] | null | null | null | lino_tera/lib/coachings/choicelists.py | khchine5/tera | dd85aaefc2392fa831bcee7c258d37038e32aeb7 | [
"BSD-2-Clause"
] | null | null | null | lino_tera/lib/coachings/choicelists.py | khchine5/tera | dd85aaefc2392fa831bcee7c258d37038e32aeb7 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Copyright 2017-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""The choicelists for this plugin.
"""
from lino.api import dd, _
class PartnerTariffs(dd.ChoiceList):
verbose_name = _("Client tariff")
verbose_name_plural = _("Client tariffs")
add = PartnerTariff... | 18.181818 | 45 | 0.67 |
from lino.api import dd, _
class PartnerTariffs(dd.ChoiceList):
verbose_name = _("Client tariff")
verbose_name_plural = _("Client tariffs")
add = PartnerTariffs.add_item
add('10', _("Plain"), 'plain')
add('20', _("Reduced"), 'reduced')
| true | true |
f7212251e63dcb5ce319603d8ff0812abad4359b | 1,095 | py | Python | synapse/resources/packages-plugin/yum-pkg.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | 1 | 2016-06-23T05:56:53.000Z | 2016-06-23T05:56:53.000Z | synapse/resources/packages-plugin/yum-pkg.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | null | null | null | synapse/resources/packages-plugin/yum-pkg.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | null | null | null | from synapse.syncmd import exec_cmd
from synapse.synapse_exceptions import ResourceException
from synapse.logger import logger
log = logger('yum-pkg')
def install(name):
ret = exec_cmd("/usr/bin/yum -q -y install {0}".format(name))
if ret['returncode'] != 0:
raise ResourceException(ret['stderr'])
d... | 28.076923 | 79 | 0.663014 | from synapse.syncmd import exec_cmd
from synapse.synapse_exceptions import ResourceException
from synapse.logger import logger
log = logger('yum-pkg')
def install(name):
ret = exec_cmd("/usr/bin/yum -q -y install {0}".format(name))
if ret['returncode'] != 0:
raise ResourceException(ret['stderr'])
d... | true | true |
f7212358f16c2908668c9722bd9e47633e14b4ef | 2,154 | py | Python | sensirion_shdlc_sensorbridge/i2c_errors.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | null | null | null | sensirion_shdlc_sensorbridge/i2c_errors.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | 1 | 2021-03-28T22:15:29.000Z | 2021-11-03T09:06:14.000Z | sensirion_shdlc_sensorbridge/i2c_errors.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# (c) Copyright 2020 Sensirion AG, Switzerland
from __future__ import absolute_import, division, print_function
import logging
log = logging.getLogger(__name__)
class SensorBridgeI2cError(IOError):
"""
I2C transceive error.
"""
def __init__(self, code, message="Unknown"):
... | 25.642857 | 81 | 0.654132 |
from __future__ import absolute_import, division, print_function
import logging
log = logging.getLogger(__name__)
class SensorBridgeI2cError(IOError):
def __init__(self, code, message="Unknown"):
super(SensorBridgeI2cError, self).__init__(
"I2C transceive error: {}".format(message)
... | true | true |
f721236e30c2bc62859814934c24d2d0a6124a36 | 1,534 | py | Python | tests/ecr/data_generator/test_vessel_parser.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | tests/ecr/data_generator/test_vessel_parser.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | tests/ecr/data_generator/test_vessel_parser.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import unittest
import yaml
from maro.data_lib.ecr.vessel_parser import VesselsParser
from maro.data_lib.ecr.entities import VesselSetting
conf_str = """
vessels:
rt1_vessel_001:
capacity: 92400
parking:
duration: 1
noise... | 25.566667 | 75 | 0.666232 |
import unittest
import yaml
from maro.data_lib.ecr.vessel_parser import VesselsParser
from maro.data_lib.ecr.entities import VesselSetting
conf_str = """
vessels:
rt1_vessel_001:
capacity: 92400
parking:
duration: 1
noise: 0
route:
initial_port_name: supply_port_001
route_nam... | true | true |
f72123b570cec67b1077598e4da57ff2404e136f | 8,077 | py | Python | corehq/util/es/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | corehq/util/es/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/util/es/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | import abc
import logging
import traceback
from django.conf import settings
from corehq.pillows.mappings.utils import transform_for_es7
from corehq.util.es.elasticsearch import bulk, scan
class AbstractElasticsearchInterface(metaclass=abc.ABCMeta):
def __init__(self, es):
self.es = es
def get_alias... | 39.985149 | 112 | 0.668317 | import abc
import logging
import traceback
from django.conf import settings
from corehq.pillows.mappings.utils import transform_for_es7
from corehq.util.es.elasticsearch import bulk, scan
class AbstractElasticsearchInterface(metaclass=abc.ABCMeta):
def __init__(self, es):
self.es = es
def get_alias... | true | true |
f72125bd49bf7f1f45aab75707173700a233a682 | 2,262 | py | Python | brave/overlays/effect.py | datagutt/brave | 5b4de55146645f96870ffc544859e6f2bb9ec735 | [
"Apache-2.0"
] | 572 | 2018-10-25T10:52:21.000Z | 2022-03-09T18:02:20.000Z | brave/overlays/effect.py | datagutt/brave | 5b4de55146645f96870ffc544859e6f2bb9ec735 | [
"Apache-2.0"
] | 50 | 2018-11-06T08:53:27.000Z | 2022-01-04T17:00:37.000Z | brave/overlays/effect.py | datagutt/brave | 5b4de55146645f96870ffc544859e6f2bb9ec735 | [
"Apache-2.0"
] | 130 | 2018-11-01T14:50:46.000Z | 2022-03-10T20:31:41.000Z | from brave.overlays.overlay import Overlay
from gi.repository import Gst
class EffectOverlay(Overlay):
'''
For doing applying a video effect.
'''
def permitted_props(self):
return {
**super().permitted_props(),
'effect_name': {
'type': 'str',
... | 41.888889 | 100 | 0.525199 | from brave.overlays.overlay import Overlay
from gi.repository import Gst
class EffectOverlay(Overlay):
def permitted_props(self):
return {
**super().permitted_props(),
'effect_name': {
'type': 'str',
'default': 'edgetv',
'permitted_v... | true | true |
f7212703196fd6c35cdef4b889edc2bf6b134e91 | 7,399 | py | Python | pytest_testrail/conftest.py | harmonm/pytest-testrail | cfd667b33cc857dd65c8531823859cd871aff525 | [
"MIT"
] | null | null | null | pytest_testrail/conftest.py | harmonm/pytest-testrail | cfd667b33cc857dd65c8531823859cd871aff525 | [
"MIT"
] | null | null | null | pytest_testrail/conftest.py | harmonm/pytest-testrail | cfd667b33cc857dd65c8531823859cd871aff525 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import os
import sys
if sys.version_info.major == 2:
# python2
import ConfigParser as configparser
else:
# python3
import configparser
from .plugin import PyTestRailPlugin
from .testrail_api import APIClient
def pytest_addoption(parser):
group = parser.getgroup('testrail')... | 41.105556 | 140 | 0.626571 |
import os
import sys
if sys.version_info.major == 2:
import ConfigParser as configparser
else:
import configparser
from .plugin import PyTestRailPlugin
from .testrail_api import APIClient
def pytest_addoption(parser):
group = parser.getgroup('testrail')
group.addoption(
'--testrail... | true | true |
f72128027575513090564f54bc3c085deb980059 | 666 | py | Python | lldb/test/API/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | 2 | 2021-11-20T04:04:47.000Z | 2022-01-06T07:44:23.000Z | lldb/test/API/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | lldb/test/API/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | # TestSwiftPOSysTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONT... | 39.176471 | 80 | 0.657658 |
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *
lldbinline.MakeInlineTest(__file__, globals(),
decorators=[swiftTest,skipIf(oslist=['windows'])])
| true | true |
f721282c9bbbd6198fca4dcb39f852eed304a1be | 16,248 | py | Python | brian2/codegen/generators/numpy_generator.py | SimonAltrogge/brian2 | 6463c368a8277041051bf5ae4816f0dd5b6e057c | [
"BSD-2-Clause"
] | 674 | 2015-01-14T11:05:39.000Z | 2022-03-29T04:53:50.000Z | brian2/codegen/generators/numpy_generator.py | JongwanKim2090/brian2 | c212a57cb992b766786b5769ebb830ff12d8a8ad | [
"BSD-2-Clause"
] | 937 | 2015-01-05T13:24:22.000Z | 2022-03-25T13:10:13.000Z | brian2/codegen/generators/numpy_generator.py | JongwanKim2090/brian2 | c212a57cb992b766786b5769ebb830ff12d8a8ad | [
"BSD-2-Clause"
] | 237 | 2015-01-05T13:54:16.000Z | 2022-03-15T22:16:32.000Z |
import itertools
import numpy as np
from brian2.parsing.bast import brian_dtype_from_dtype
from brian2.parsing.rendering import NumpyNodeRenderer
from brian2.core.functions import DEFAULT_FUNCTIONS, timestep
from brian2.core.variables import ArrayVariable
from brian2.utils.stringtools import get_identifiers, word_su... | 46.959538 | 110 | 0.551576 |
import itertools
import numpy as np
from brian2.parsing.bast import brian_dtype_from_dtype
from brian2.parsing.rendering import NumpyNodeRenderer
from brian2.core.functions import DEFAULT_FUNCTIONS, timestep
from brian2.core.variables import ArrayVariable
from brian2.utils.stringtools import get_identifiers, word_su... | true | true |
f721282f6a2dc461afc65e2af7a6340bab2f41d6 | 7,584 | py | Python | cfripper/rules/wildcard_principals.py | claytonbrown/cfripper | 869eb5861da3fcfaa5e2f5e877fa9c30f60cfce9 | [
"Apache-2.0"
] | 360 | 2018-08-08T12:34:58.000Z | 2022-03-25T17:01:41.000Z | cfripper/rules/wildcard_principals.py | Skyscanner/cfripper | 1bc3ff483ac9c126037f796950ebe52cf463ac17 | [
"Apache-2.0"
] | 40 | 2018-11-26T07:08:15.000Z | 2022-03-02T09:10:45.000Z | cfripper/rules/wildcard_principals.py | claytonbrown/cfripper | 869eb5861da3fcfaa5e2f5e877fa9c30f60cfce9 | [
"Apache-2.0"
] | 51 | 2018-11-09T11:46:32.000Z | 2022-03-28T08:47:28.000Z | __all__ = ["GenericWildcardPrincipalRule", "PartialWildcardPrincipalRule", "FullWildcardPrincipalRule"]
import logging
import re
from typing import Dict, Optional
from pycfmodel.model.cf_model import CFModel
from pycfmodel.model.resources.iam_managed_policy import IAMManagedPolicy
from pycfmodel.model.resources.iam_po... | 54.956522 | 120 | 0.587421 | __all__ = ["GenericWildcardPrincipalRule", "PartialWildcardPrincipalRule", "FullWildcardPrincipalRule"]
import logging
import re
from typing import Dict, Optional
from pycfmodel.model.cf_model import CFModel
from pycfmodel.model.resources.iam_managed_policy import IAMManagedPolicy
from pycfmodel.model.resources.iam_po... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.