hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d2c7b76707c1c34caecd1747cce3b0041e9d7637 | 3,587 | py | Python | gdwrap/Gdwrap.py | nabeen/gdwrap | c51c27bc347f98ce334d84a943237080f1f3bb6d | [
"MIT"
] | null | null | null | gdwrap/Gdwrap.py | nabeen/gdwrap | c51c27bc347f98ce334d84a943237080f1f3bb6d | [
"MIT"
] | 3 | 2017-12-19T11:14:07.000Z | 2017-12-22T01:45:38.000Z | gdwrap/Gdwrap.py | nabeen/gdwrap | c51c27bc347f98ce334d84a943237080f1f3bb6d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Google Drive REST API wrapper class.
Have a nice day:D
"""
import os
import io
import httplib2
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from googleapiclient import discovery
from googleapiclient.http import... | 30.142857 | 88 | 0.609144 |
b3cbcf3fe6d81e49d6b70a5ecdaa21be3b1bd20e | 1,489 | py | Python | cpmpy/euler2.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | cpmpy/euler2.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | cpmpy/euler2.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | """
Project Euler problem 2 in cpmpy.
http://projecteuler.net/index.php?section=problems&id=2
'''
Each new term in the Fibonacci sequence is generated by adding the
previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Find the sum of all the even-valued te... | 26.589286 | 95 | 0.556078 |
e7215f7f385d2a9854007903557a5ce93f421543 | 23,916 | py | Python | Lib/site-packages/pip/_vendor/rich/segment.py | F4Ruke/FF14FishingBot | 53f73b9db8a95b2b718a36a9746471046c45117d | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/pip/_vendor/rich/segment.py | F4Ruke/FF14FishingBot | 53f73b9db8a95b2b718a36a9746471046c45117d | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/pip/_vendor/rich/segment.py | F4Ruke/FF14FishingBot | 53f73b9db8a95b2b718a36a9746471046c45117d | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | from enum import IntEnum
from functools import lru_cache
from itertools import filterfalse
from logging import getLogger
from operator import attrgetter
from typing import (
TYPE_CHECKING,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Type,
Union,
)
from .cells im... | 33.170596 | 110 | 0.552601 |
43494b565f7e9acd24503e85073762f7f48b4376 | 1,601 | py | Python | noxfile.py | kcen/httpx | a05ba2e9148c3f74c80c68a727b7e52b3d751c8c | [
"BSD-3-Clause"
] | null | null | null | noxfile.py | kcen/httpx | a05ba2e9148c3f74c80c68a727b7e52b3d751c8c | [
"BSD-3-Clause"
] | null | null | null | noxfile.py | kcen/httpx | a05ba2e9148c3f74c80c68a727b7e52b3d751c8c | [
"BSD-3-Clause"
] | null | null | null | import nox
nox.options.stop_on_first_error = True
nox.options.reuse_existing_virtualenvs = True
nox.options.keywords = "not serve"
source_files = ("httpx", "tools", "tests", "setup.py", "noxfile.py")
@nox.session
def lint(session):
session.install(
"--upgrade", "autoflake", "black", "flake8", "isort", "... | 28.589286 | 87 | 0.635228 |
1672d3c7577b0978ab913cb6f22d6f0463c60bf3 | 8,961 | py | Python | themes/minimal/base16-decaf.config.py | pltanton/base16-qutebrowser | dff61f51e10906491034e15f6b78440ce06dbc1a | [
"MIT"
] | null | null | null | themes/minimal/base16-decaf.config.py | pltanton/base16-qutebrowser | dff61f51e10906491034e15f6b78440ce06dbc1a | [
"MIT"
] | null | null | null | themes/minimal/base16-decaf.config.py | pltanton/base16-qutebrowser | dff61f51e10906491034e15f6b78440ce06dbc1a | [
"MIT"
] | null | null | null | # base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# Decaf scheme by Alex Mirrington (https://github.com/alexmirrington)
base00 = "#2d2d2d"
base01 = "#393939"
base02 = "#515151"
base03 = "#777777"
base04 = "#b4b7b4"
base05 = "#cccccc"
base06 =... | 30.07047 | 95 | 0.771789 |
326800c64ea3b74e49c17765b92785c6813e6f60 | 1,279 | py | Python | francoralite/apps/francoralite_front/views/search.py | Francoralite/francoralite | f8c5eeffe6d395c7e4222a9f5a4a7a01841b503c | [
"BSD-3-Clause"
] | 2 | 2021-07-26T08:29:26.000Z | 2021-07-26T08:29:27.000Z | francoralite/apps/francoralite_front/views/search.py | lluc/telemeta-integration | c2fb116471235674eae597abac84a7113e0f7c82 | [
"BSD-3-Clause"
] | 167 | 2018-10-20T14:34:46.000Z | 2021-06-01T10:40:55.000Z | francoralite/apps/francoralite_front/views/search.py | Francoralite/francoralite | f8c5eeffe6d395c7e4222a9f5a4a7a01841b503c | [
"BSD-3-Clause"
] | 1 | 2021-06-06T12:16:49.000Z | 2021-06-06T12:16:49.000Z | # -*- coding: utf-8 -*-
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Authors: Luc LEGER / Coopérative ARTEFACTS <artefacts.lle@gmail.com>
from francoralite.apps.francoralite_front.francoralite_template_view import... | 37.617647 | 100 | 0.601251 |
f7619099600ba228c5f64fad0218c5878873ec0b | 3,556 | py | Python | seisflows/system/multicore.py | fanwu8/sf | 8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf | [
"BSD-2-Clause"
] | 1 | 2021-09-17T18:25:55.000Z | 2021-09-17T18:25:55.000Z | seisflows/system/multicore.py | fanwu8/sf | 8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf | [
"BSD-2-Clause"
] | null | null | null | seisflows/system/multicore.py | fanwu8/sf | 8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf | [
"BSD-2-Clause"
] | 1 | 2019-06-27T19:16:30.000Z | 2019-06-27T19:16:30.000Z |
import os
import sys
import numpy as np
from os.path import abspath, basename, join
from subprocess import Popen
from time import sleep
from seisflows.tools import unix
from seisflows.tools.tools import call, findpath, nproc, saveobj
from seisflows.config import ParameterError, custom_import
PAR = sys.modules['seis... | 29.38843 | 88 | 0.579021 |
cd4bab21a330101028c012ba3b5e4811c0f14400 | 2,450 | py | Python | setup.py | Fmajor/grizli | 006f4790f3bce492ea941d59a58b3876bdec9e8c | [
"MIT"
] | 2 | 2020-06-27T13:01:16.000Z | 2021-01-25T07:34:11.000Z | setup.py | Fmajor/grizli | 006f4790f3bce492ea941d59a58b3876bdec9e8c | [
"MIT"
] | null | null | null | setup.py | Fmajor/grizli | 006f4790f3bce492ea941d59a58b3876bdec9e8c | [
"MIT"
] | 1 | 2021-03-23T12:12:34.000Z | 2021-03-23T12:12:34.000Z | #from distutils.core import setup
#from distutils.extension import Extension
from setuptools import setup
from setuptools.extension import Extension
import subprocess
import os
import numpy
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
if not os.path.ex... | 29.166667 | 111 | 0.669796 |
af981e85ff8c974e1c5bb2710b7219a1c03643a0 | 38,785 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/ipv4_labeled_unicast/prefix_limit/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/ipv4_labeled_unicast/prefix_limit/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/ipv4_labeled_unicast/prefix_limit/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 42.574094 | 518 | 0.619363 |
48ada94d6febe9d6bf3e168f3a97fe73ac1d7452 | 11,766 | py | Python | lightfm/evaluation.py | linggom/lightfm | 77b1d17decb94032f6d044bb89a9e3378a7dfaf1 | [
"Apache-2.0"
] | null | null | null | lightfm/evaluation.py | linggom/lightfm | 77b1d17decb94032f6d044bb89a9e3378a7dfaf1 | [
"Apache-2.0"
] | null | null | null | lightfm/evaluation.py | linggom/lightfm | 77b1d17decb94032f6d044bb89a9e3378a7dfaf1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
Module containing evaluation functions suitable for judging the performance of
a fitted LightFM model.
"""
import numpy as np
from ._lightfm_fast import CSRMatrix, calculate_auc_from_rank
__all__ = ["precision_at_k", "recall_at_k", "auc_score", "reciprocal_rank"]
def precision_at_k(
model,
... | 37.234177 | 90 | 0.698793 |
95418c3639c7ecfb8bc6c5783908dd07e5b3ed96 | 2,221 | py | Python | ogr/services/pagure/comments.py | mmuzila/ogr | 8cce532ff10f0165c51d4e37aebd6db548e8e1ab | [
"MIT"
] | null | null | null | ogr/services/pagure/comments.py | mmuzila/ogr | 8cce532ff10f0165c51d4e37aebd6db548e8e1ab | [
"MIT"
] | 5 | 2020-01-21T07:55:22.000Z | 2020-01-25T15:12:51.000Z | ogr/services/pagure/comments.py | mmuzila/ogr | 8cce532ff10f0165c51d4e37aebd6db548e8e1ab | [
"MIT"
] | 1 | 2020-01-25T14:40:32.000Z | 2020-01-25T14:40:32.000Z | # MIT License
#
# Copyright (c) 2018-2019 Red Hat, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... | 37.644068 | 85 | 0.734354 |
bb75c846e757ba6b3a643be1d9a50825bd9808ed | 12,249 | py | Python | dependencies/quex-0.34.1/quex/token_id_maker.py | lavrod/grit-engine | 86499eb3f171546cb186138b9fe0fb7baf1894ed | [
"MIT"
] | 109 | 2016-06-22T22:41:27.000Z | 2022-03-27T02:30:36.000Z | dependencies/quex-0.34.1/quex/token_id_maker.py | lavrod/grit-engine | 86499eb3f171546cb186138b9fe0fb7baf1894ed | [
"MIT"
] | 12 | 2016-06-22T02:06:51.000Z | 2021-11-01T03:06:54.000Z | dependencies/quex-0.34.1/quex/token_id_maker.py | lavrod/grit-engine | 86499eb3f171546cb186138b9fe0fb7baf1894ed | [
"MIT"
] | 30 | 2016-06-21T22:10:46.000Z | 2022-03-10T20:05:11.000Z | #! /usr/bin/env python
import time
import os
import sys
import re
from GetPot import GetPot
import quex.frs_py.file_in as file_in
import quex.lexer_mode as lexer_mode
from quex.frs_py.string_handling import blue_print
class TokenInfo:
def __init__(self, Name, ID, TypeName=None, Filename="", LineN=-1):
... | 43.43617 | 255 | 0.623479 |
da9708cd0373db1cffae7b603e03cff90e458ceb | 6,080 | py | Python | ska-tmc/ska-tmc-subarraynode-low/src/ska_tmc_subarraynode_low/obs_state_aggregator.py | ska-telescope/tmc-prototype | 4138274e933d4b05f7fe9fc34a11c417b6d0d336 | [
"BSD-3-Clause"
] | 3 | 2019-01-10T11:49:36.000Z | 2019-07-19T03:32:52.000Z | ska-tmc/ska-tmc-subarraynode-low/src/ska_tmc_subarraynode_low/obs_state_aggregator.py | ska-telescope/tmc-prototype | 4138274e933d4b05f7fe9fc34a11c417b6d0d336 | [
"BSD-3-Clause"
] | 19 | 2019-01-07T14:50:26.000Z | 2019-10-02T13:25:23.000Z | ska-tmc/ska-tmc-subarraynode-low/src/ska_tmc_subarraynode_low/obs_state_aggregator.py | ska-telescope/tmc-prototype | 4138274e933d4b05f7fe9fc34a11c417b6d0d336 | [
"BSD-3-Clause"
] | 1 | 2018-12-21T13:39:23.000Z | 2018-12-21T13:39:23.000Z | # Standard python import
import logging
# Additional import
from ska.base.control_model import ObsState
from tmc.common.tango_client import TangoClient
from tmc.common.tango_server_helper import TangoServerHelper
from .device_data import DeviceData
from . import const
from time import sleep
class ObsStateAggregator:... | 41.081081 | 138 | 0.624178 |
f0114158785a2e11c9aaa4142ceb3054cd2a3a8e | 1,976 | py | Python | test_all_notebooks.py | scottprahl/pyspeckle | 6a81a07e583589121279f5d4d73ab0b1a4b57b87 | [
"MIT"
] | 7 | 2019-06-26T05:14:43.000Z | 2022-03-06T17:01:59.000Z | test_all_notebooks.py | scottprahl/pyspeckle | 6a81a07e583589121279f5d4d73ab0b1a4b57b87 | [
"MIT"
] | null | null | null | test_all_notebooks.py | scottprahl/pyspeckle | 6a81a07e583589121279f5d4d73ab0b1a4b57b87 | [
"MIT"
] | 5 | 2019-07-14T05:08:21.000Z | 2020-06-05T18:43:47.000Z | """
This file is intended to be the target of a pytest run.
It will recursively find all .ipynb files in the current directory, ignoring
directories that start with . and any files matching patterins found in the file
.testignore
List patterns to skip in .testignore file:
under_construction/*
Sample invocations... | 30.875 | 80 | 0.709514 |
a899f73801954bfb577849dc8a30dfd2484b446a | 8,254 | py | Python | examples/information_extraction/wordtag/predictor.py | jeff41404/PaddleNLP | 76065a904584f07a60894898334dae437b1ce018 | [
"Apache-2.0"
] | null | null | null | examples/information_extraction/wordtag/predictor.py | jeff41404/PaddleNLP | 76065a904584f07a60894898334dae437b1ce018 | [
"Apache-2.0"
] | null | null | null | examples/information_extraction/wordtag/predictor.py | jeff41404/PaddleNLP | 76065a904584f07a60894898334dae437b1ce018 | [
"Apache-2.0"
] | null | null | null | import json
import paddle
import paddle.nn as nn
from paddlenlp.datasets import MapDataset
from paddlenlp.data import Stack, Pad, Tuple
from paddlenlp.transformers import ErnieCtmWordtagModel, ErnieCtmTokenizer
class WordtagPredictor(object):
"""Predictor of wordtag model.
"""
def __init__(self, model_d... | 38.390698 | 114 | 0.525806 |
11b573a0a51e964af9082c8773b137b1e01f2b44 | 4,935 | py | Python | test_summary.py | luke1226/vscode_sln_template | 4a071ae2d8397050d947062daff22bcedec3e928 | [
"MIT"
] | null | null | null | test_summary.py | luke1226/vscode_sln_template | 4a071ae2d8397050d947062daff22bcedec3e928 | [
"MIT"
] | null | null | null | test_summary.py | luke1226/vscode_sln_template | 4a071ae2d8397050d947062daff22bcedec3e928 | [
"MIT"
] | null | null | null | import subprocess
from termcolor import cprint
class TestSummaryParser:
def parse(self, summary):
return [
self.__parseAllTests(summary),
self.__parseSuccessTests(summary),
self.__parseFailedTests(summary),
self.__parseFailedTestsCallstacks(summary)
... | 32.254902 | 136 | 0.705572 |
56de9f312c49ed70f675fa460f87b0a913b76df3 | 259 | py | Python | Tests/test_solver_random_walk.py | Eberhofer/MasterMind | 321838fed4ffed002468dbbe4fef55c2db8da3ed | [
"MIT"
] | 1 | 2020-02-29T14:48:39.000Z | 2020-02-29T14:48:39.000Z | Tests/test_solver_random_walk.py | Eberhofer/MasterMind | 321838fed4ffed002468dbbe4fef55c2db8da3ed | [
"MIT"
] | null | null | null | Tests/test_solver_random_walk.py | Eberhofer/MasterMind | 321838fed4ffed002468dbbe4fef55c2db8da3ed | [
"MIT"
] | 1 | 2021-04-28T06:01:50.000Z | 2021-04-28T06:01:50.000Z | import pytest
from MasterMind.game import Game
from MasterMind.solvers import random_walk
@pytest.fixture
def g():
return Game()
def test_solution_is_correct(g):
assert random_walk.random_walk(g)[0] ==[g.colordict[g.challenge[i]] for i in g._slots]
| 23.545455 | 90 | 0.760618 |
7b2f63cda6e3cc4064afeaf3427d8febdafa546a | 32,503 | py | Python | python/ccxt/tidex.py | KenMan79/ccxt | e93be820b35d1c2bfb10d01e49f7cb41e489bd9c | [
"MIT"
] | 1 | 2021-06-26T15:28:37.000Z | 2021-06-26T15:28:37.000Z | python/ccxt/tidex.py | KenMan79/ccxt | e93be820b35d1c2bfb10d01e49f7cb41e489bd9c | [
"MIT"
] | 3 | 2021-06-26T15:32:50.000Z | 2021-06-28T12:07:01.000Z | python/ccxt/tidex.py | KenMan79/ccxt | e93be820b35d1c2bfb10d01e49f7cb41e489bd9c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 40.12716 | 248 | 0.478848 |
72f84648e9238f57205383fea9b02249d7b6e6f3 | 6,123 | py | Python | compute_data_stats.py | atharva-naik/HeadlineGen | cbb36cfd6faa8ce36009eae6eddf6a073c10d9d8 | [
"MIT"
] | null | null | null | compute_data_stats.py | atharva-naik/HeadlineGen | cbb36cfd6faa8ce36009eae6eddf6a073c10d9d8 | [
"MIT"
] | null | null | null | compute_data_stats.py | atharva-naik/HeadlineGen | cbb36cfd6faa8ce36009eae6eddf6a073c10d9d8 | [
"MIT"
] | null | null | null | import os
import re
import copy
import json
import tqdm
import pprint
import sklearn
import pandas as pd
from sklearn.model_selection import train_test_split
for lib in ["emoji", "fasttext", "google_trans_new"]:
try:
exec(f"import {lib}")
except ImportError:
os.system(f"pip install {lib}")
... | 30.924242 | 120 | 0.584027 |
83c59585559a01bb3463ba52a555aadccf9c0e9a | 285 | py | Python | Uche Clare/Phase 2/String/Day 34/Task 10.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Uche Clare/Phase 2/String/Day 34/Task 10.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Uche Clare/Phase 2/String/Day 34/Task 10.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | #Write a Python program to capitalize first and last letters of each word of a given string.
str1 = "CodedLadies Innovate is a python oriented group."
str1 = result = str1.title()
result = ""
for word in str1.split():
result += word[:-1] + word[-1].upper() + " "
print(result[:-1]) | 40.714286 | 92 | 0.684211 |
c6d5762811d667d4914aadb493fb7e7fd3b86a62 | 3,893 | py | Python | ns-allinone-3.35/ns-3.35/src/applications/bindings/callbacks_list.py | usi-systems/cc | 487aa9e322b2b01b6af3a92e38545c119e4980a3 | [
"Apache-2.0"
] | 1 | 2022-03-22T08:08:35.000Z | 2022-03-22T08:08:35.000Z | ns-3-dev/src/applications/bindings/callbacks_list.py | Marquez607/Wireless-Perf-Sim | 1086759b6dbe7da192225780d5fe6a3da0c5eb07 | [
"MIT"
] | null | null | null | ns-3-dev/src/applications/bindings/callbacks_list.py | Marquez607/Wireless-Perf-Sim | 1086759b6dbe7da192225780d5fe6a3da0c5eb07 | [
"MIT"
] | null | null | null | callback_classes = [
['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['... | 149.730769 | 210 | 0.579245 |
95a85561945197ebb32541ee50ac595205319529 | 2,843 | py | Python | Clustering/KMeans_General.py | mmitic/Machine-Learning-algorithms-Python- | 2f228a88d64b7c2748dfafbe41c0984dcf8923b0 | [
"MIT"
] | 1 | 2015-08-09T21:12:51.000Z | 2015-08-09T21:12:51.000Z | Clustering/KMeans_General.py | mmitic/Machine-Learning-algorithms-Python- | 2f228a88d64b7c2748dfafbe41c0984dcf8923b0 | [
"MIT"
] | null | null | null | Clustering/KMeans_General.py | mmitic/Machine-Learning-algorithms-Python- | 2f228a88d64b7c2748dfafbe41c0984dcf8923b0 | [
"MIT"
] | 1 | 2015-12-29T13:11:43.000Z | 2015-12-29T13:11:43.000Z | # -*- coding: utf-8 -*-
### General KMeans (tested on iris, wine and segment dataset)
### author: Dr. Marko Mitic
### year: 2015
### contact: miticm@gmail.com
import numpy as np
class KMeans:
def __init__(self, dataraw):
#FOR IRIS DATASET!
#self.y = dataraw[:,-1] # outputs - cluste... | 29.010204 | 134 | 0.476609 |
f714a3eab380aa3fea7349fb1fb1cb7718fcf9fb | 2,713 | py | Python | test/pyaz/acr/helm/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/acr/helm/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/acr/helm/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
def list(name, repository=None, resource_group=None, suffix=None, username=None, password=None):
params = get_params(locals())
command = "az acr helm list " + params
print(command)
output = subprocess.run(command, shell=Tru... | 36.662162 | 133 | 0.669001 |
ee727a39ef7d8d5c8b419b19b5e3684fbd4957dd | 2,319 | py | Python | src/programy/extensions/admin/rdf.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/extensions/admin/rdf.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/extensions/admin/rdf.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | 1 | 2020-02-21T17:58:05.000Z | 2020-02-21T17:58:05.000Z | """
Copyright (c) 2016-17 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, mod... | 41.410714 | 120 | 0.648555 |
29ffa6b046114e4a14838d8358b619af2699e568 | 4,416 | py | Python | src/cv_2.py | jbrowarczyk/jb-masters-thesis | c345f43b32126d16f10c3706f5f798fde0665ee0 | [
"MIT"
] | null | null | null | src/cv_2.py | jbrowarczyk/jb-masters-thesis | c345f43b32126d16f10c3706f5f798fde0665ee0 | [
"MIT"
] | null | null | null | src/cv_2.py | jbrowarczyk/jb-masters-thesis | c345f43b32126d16f10c3706f5f798fde0665ee0 | [
"MIT"
] | null | null | null | from sklearn.decomposition import PCA
from sklearn.model_selection import KFold
import numpy as np
import os
import joblib
import traceback
from experiment2 import experiment_svm_linear
from utils import save_txt
from crossval_utils import make_crossvalidation_data, numeral_str, make_report, dots_to_underscores
from... | 34.771654 | 128 | 0.69837 |
f904e1339d3e8b25079fc921d5ec2eee782ef27f | 7,614 | py | Python | options/train_options.py | chickenfingerwu/CLV-dataset | 759035836510485ca8bda6af37d7dce498f2e211 | [
"MIT"
] | 192 | 2020-06-02T06:26:42.000Z | 2022-03-10T10:57:33.000Z | options/train_options.py | chickenfingerwu/CLV-dataset | 759035836510485ca8bda6af37d7dce498f2e211 | [
"MIT"
] | 23 | 2020-06-30T02:08:45.000Z | 2022-03-27T04:59:24.000Z | options/train_options.py | chickenfingerwu/CLV-dataset | 759035836510485ca8bda6af37d7dce498f2e211 | [
"MIT"
] | 52 | 2020-06-10T08:21:58.000Z | 2022-03-07T00:21:53.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT
from .base_options import BaseOptions
class TrainOptions(BaseOptions):
"""This class includes training options.
It also includes shared options defined in BaseOptions.
"""
def initialize(self, parser... | 78.494845 | 210 | 0.637247 |
179aefad83818a1bea8328054b0c3621640fb468 | 11,346 | py | Python | virusscan/tests.py | scsich/phagescan | 3394b6a80e62c175b1e10477f58f7b609c399085 | [
"Apache-2.0"
] | 21 | 2015-02-03T18:41:23.000Z | 2022-03-18T20:16:13.000Z | virusscan/tests.py | scsich/phagescan | 3394b6a80e62c175b1e10477f58f7b609c399085 | [
"Apache-2.0"
] | null | null | null | virusscan/tests.py | scsich/phagescan | 3394b6a80e62c175b1e10477f58f7b609c399085 | [
"Apache-2.0"
] | 6 | 2015-03-03T11:22:21.000Z | 2021-07-18T10:59:15.000Z | """
Run "manage.py test".
"""
# -*- coding: utf_8 -*-
from operator import attrgetter
import tempfile
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from celery import states
from uuid import uuid4
from shutil import copyfile
from os import... | 40.521429 | 138 | 0.787326 |
327a07ed89cbb276106bbad5d258577c2bb47f66 | 610 | py | Python | git-python/test/git/test_utils.py | kergoth/git-origin | 585af979a6cbb705b904bdbdde1293c9c10fbc5e | [
"MIT"
] | 3 | 2016-01-13T16:03:05.000Z | 2022-03-10T19:34:08.000Z | git-python/test/git/test_utils.py | kergoth/git-origin | 585af979a6cbb705b904bdbdde1293c9c10fbc5e | [
"MIT"
] | null | null | null | git-python/test/git/test_utils.py | kergoth/git-origin | 585af979a6cbb705b904bdbdde1293c9c10fbc5e | [
"MIT"
] | 1 | 2022-03-10T19:34:13.000Z | 2022-03-10T19:34:13.000Z | # test_utils.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
from test.testlib import *
from git import *
class TestUtils(object):
def setup(se... | 27.727273 | 76 | 0.629508 |
da8af182e35648b9e1a8b37af8b90e4a1030f8c6 | 884 | py | Python | game/migrations/0008_player.py | josh-perry/venture | ca2a288f5593db5fe900949be87441e0efbc85f2 | [
"MIT"
] | null | null | null | game/migrations/0008_player.py | josh-perry/venture | ca2a288f5593db5fe900949be87441e0efbc85f2 | [
"MIT"
] | null | null | null | game/migrations/0008_player.py | josh-perry/venture | ca2a288f5593db5fe900949be87441e0efbc85f2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-14 23:30
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependen... | 32.740741 | 121 | 0.656109 |
92b34f5451884c9ae0b4d9201029fb9dd99c3c70 | 399 | py | Python | molecool/atom_data.py | rposh/molecool | 9ddbb3b5615c6301b7f20f37f1899a861925fabf | [
"BSD-3-Clause"
] | null | null | null | molecool/atom_data.py | rposh/molecool | 9ddbb3b5615c6301b7f20f37f1899a861925fabf | [
"BSD-3-Clause"
] | null | null | null | molecool/atom_data.py | rposh/molecool | 9ddbb3b5615c6301b7f20f37f1899a861925fabf | [
"BSD-3-Clause"
] | null | null | null | """
This has atom characteristics
"""
atomic_weights = {
'H': 1.00784,
'C': 12.0107,
'N': 14.0067,
'O': 15.999,
'P': 30.973762,
'F': 18.998403,
'Cl': 35.453,
'Br': 79.904,
}
atom_colors = {
'H': 'white',
'C': '#D3D3D3',
'N': '#add8e6',
'O': 'red',
'P': '#FFA500',
... | 15.346154 | 29 | 0.428571 |
f6fcaecaaeb334f54909beb5e23fff4578756c8d | 10,234 | py | Python | ID18_U18_TWO_LENSES/paper_cases_7keV/CASE-CAUSTIC/case1h_wofry.py | srio/paper-transfocators-resources | 917d8b4114056f62c84b295579e55bf5f0b56b6b | [
"MIT"
] | 1 | 2021-03-25T15:34:56.000Z | 2021-03-25T15:34:56.000Z | ID18_U18_TWO_LENSES/paper_cases_7keV/CASE-CAUSTIC/case1h_wofry.py | srio/paper-transfocators-resources | 917d8b4114056f62c84b295579e55bf5f0b56b6b | [
"MIT"
] | null | null | null | ID18_U18_TWO_LENSES/paper_cases_7keV/CASE-CAUSTIC/case1h_wofry.py | srio/paper-transfocators-resources | 917d8b4114056f62c84b295579e55bf5f0b56b6b | [
"MIT"
] | null | null | null |
#
# Import section
#
import numpy
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates
from wofry.propagator.propagator import PropagationManager, PropagationElements, PropagationParameters
from wofry.propagator.wavefront1D.generic_wavefront im... | 31.98125 | 220 | 0.689564 |
85d33537047fe3df13448599068328cfac6de05e | 5,179 | py | Python | pyupdater/vendor/PyInstaller/depend/modules.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | null | null | null | pyupdater/vendor/PyInstaller/depend/modules.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | null | null | null | pyupdater/vendor/PyInstaller/depend/modules.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | 28.146739 | 115 | 0.615949 |
9364ceac0f8135bfdc3b96ba4683fb820d0f7307 | 1,915 | py | Python | multiple_user_representations/models/parametric_attention_test.py | xxdreck/google-research | dac724bc2b9362d65c26747a8754504fe4c615f8 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | multiple_user_representations/models/parametric_attention_test.py | xxdreck/google-research | dac724bc2b9362d65c26747a8754504fe4c615f8 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | multiple_user_representations/models/parametric_attention_test.py | admariner/google-research | 7cee4b22b925581d912e8d993625c180da2a5a4f | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.393443 | 74 | 0.737337 |
6e95ac981ab69954f9e8d98025ce1f2fceaf89f9 | 10,267 | py | Python | Code/FlickrDataCollection_searchAPI.py | jrc-vgi-ff/PublicResearchPortfolio | 154a08b48388d37f966ed736713216da9b176b84 | [
"MIT"
] | null | null | null | Code/FlickrDataCollection_searchAPI.py | jrc-vgi-ff/PublicResearchPortfolio | 154a08b48388d37f966ed736713216da9b176b84 | [
"MIT"
] | 1 | 2017-06-21T08:08:39.000Z | 2017-06-21T08:08:39.000Z | Code/FlickrDataCollection_searchAPI.py | jrc-vgi-ff/PublicResearchPortfolio | 154a08b48388d37f966ed736713216da9b176b84 | [
"MIT"
] | 1 | 2018-04-06T12:03:07.000Z | 2018-04-06T12:03:07.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@author: OstermannFO
flickrdatacollection_searchAPI.py:
access FlickrAPI
write metadata in text file
code is not optimized for performance or brevity,
aims instead for readability and ease of understanding
"""
import flickrapi
import datetime
import time
... | 38.597744 | 91 | 0.526249 |
6e10d167412cf50c71b9081556cae540aeb76e98 | 3,302 | py | Python | applications/RANSApplication/python_scripts/model_part_factory.py | HubertBalcerzak/Kratos | c15689d53f06dabb36dc44c13eeac73d3e183916 | [
"BSD-4-Clause"
] | null | null | null | applications/RANSApplication/python_scripts/model_part_factory.py | HubertBalcerzak/Kratos | c15689d53f06dabb36dc44c13eeac73d3e183916 | [
"BSD-4-Clause"
] | 1 | 2019-12-05T05:33:34.000Z | 2019-12-05T05:33:34.000Z | applications/RANSApplication/python_scripts/model_part_factory.py | HayoungChung/Kratos | 8a996625261ecf2e33923df95e449c0874d6f4f5 | [
"BSD-4-Clause"
] | null | null | null | import KratosMultiphysics as Kratos
from KratosMultiphysics.RANSApplication import RansVariableUtilities
def CreateDuplicateModelPart(origin_modelpart, destination_modelpart_name,
element_name, condition_name,
original_condition_name):
# domain_size = orig... | 47.855072 | 129 | 0.696245 |
4c8542273e34a79257169bf66fadea30502359ee | 4,470 | py | Python | ml/rl/evaluation/sequential_doubly_robust_estimator.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | 2 | 2021-02-10T12:03:37.000Z | 2021-03-14T19:32:43.000Z | ml/rl/evaluation/sequential_doubly_robust_estimator.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | null | null | null | ml/rl/evaluation/sequential_doubly_robust_estimator.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
from typing import List
import numpy as np
import torch
from ml.rl.evaluation.cpe import CpeEstimate, bootstrapped_std_error_of_mean
from ml.rl.evaluation.evaluation_data_page import EvaluationDataPage
logg... | 37.881356 | 91 | 0.612528 |
a2f18ecf044868131be40e87982010d267c69f01 | 22,628 | py | Python | nipype/workflows/dmri/fsl/tbss.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2019-01-25T18:20:51.000Z | 2019-07-30T20:51:51.000Z | nipype/workflows/dmri/fsl/tbss.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/workflows/dmri/fsl/tbss.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2018-01-25T19:48:17.000Z | 2019-01-25T18:20:52.000Z | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from warnings import warn
from ....pipeline import engine as pe
from ....interfaces import utility as util
from ....interfaces import fsl as fsl
def tbss1_op_string(in_... | 38.614334 | 113 | 0.522362 |
e8787da23ff99c610c67162797f7dd9d9b74b76c | 1,415 | py | Python | training/xgboost/structured/base/setup.py | singh08prashant/ai-platform-samples | 5e640cb0e8ba41c6381a14c874cd870b767d0302 | [
"Apache-2.0"
] | null | null | null | training/xgboost/structured/base/setup.py | singh08prashant/ai-platform-samples | 5e640cb0e8ba41c6381a14c874cd870b767d0302 | [
"Apache-2.0"
] | null | null | null | training/xgboost/structured/base/setup.py | singh08prashant/ai-platform-samples | 5e640cb0e8ba41c6381a14c874cd870b767d0302 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019 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 a... | 33.690476 | 80 | 0.693286 |
8031aebc964bb3998497a5d5cbce8c7d561050d5 | 8,703 | py | Python | tph/tph/settings.py | mitsuhisaT/django-rpi-tph-monitor | 59938456484c09149966605c848eb3a3b1eb5837 | [
"MIT"
] | 1 | 2021-01-24T03:06:58.000Z | 2021-01-24T03:06:58.000Z | tph/tph/settings.py | mitsuhisaT/django-rpi-tph-monitor | 59938456484c09149966605c848eb3a3b1eb5837 | [
"MIT"
] | 9 | 2021-03-18T21:47:39.000Z | 2021-11-22T23:55:35.000Z | tph/tph/settings.py | mitsuhisaT/django-rpi-tph-monitor | 59938456484c09149966605c848eb3a3b1eb5837 | [
"MIT"
] | 4 | 2019-11-13T12:32:14.000Z | 2020-01-29T12:51:07.000Z | """
Django settings for tph project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib impor... | 27.454259 | 115 | 0.652878 |
3e160b39a5a1d86e421837116baf2f0f5ef628ed | 782 | py | Python | Web Exploitation/Sql Injection/sqli-labs/Chapter-12/test2.py | AbhilashG97/CrimsonGhostChili | c97fca46a02e7c2597f6bd1341c752eb2286740d | [
"Apache-2.0"
] | 1 | 2020-10-01T16:45:50.000Z | 2020-10-01T16:45:50.000Z | Web Exploitation/Sql Injection/sqli-labs/Chapter-12/test2.py | AbhilashG97/CrimsonGhostChili | c97fca46a02e7c2597f6bd1341c752eb2286740d | [
"Apache-2.0"
] | null | null | null | Web Exploitation/Sql Injection/sqli-labs/Chapter-12/test2.py | AbhilashG97/CrimsonGhostChili | c97fca46a02e7c2597f6bd1341c752eb2286740d | [
"Apache-2.0"
] | null | null | null | import requests
from Cookie import SimpleCookie
url_post = "http://3043c2d0bc0afd60c260b8757486978f.n1.vsgo.cloud:11460/sqlilabs/Less-44/index.php"
payload_correct = {'login_user':'admin', 'login_password':"admin' #"}
payload_wrong = {'login_user':'admin', 'login_password':"admin' #"}
cookie_post = {"PHPSESSID":"f99... | 35.545455 | 99 | 0.735294 |
05f6c43d94a08a375fce40d16392361ee4071a99 | 376 | py | Python | Python/text processing/adjoint.py | Fornost461/drafts | 39f56fb16ebf206077e5f8617741aa93623195af | [
"CC0-1.0"
] | null | null | null | Python/text processing/adjoint.py | Fornost461/drafts | 39f56fb16ebf206077e5f8617741aa93623195af | [
"CC0-1.0"
] | null | null | null | Python/text processing/adjoint.py | Fornost461/drafts | 39f56fb16ebf206077e5f8617741aa93623195af | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# Usage:
# py -i search-replace.py
import clipboard
# un facteur par ligne
ti=r'''
M_{(q_1,q_0) \mapsto \conj{\omega}(q_0^{-1},q_1)}
\Sigma
(1\otimes T_\phi)
(1\otimes\F_V)
M_{(q_0,v_0) \mapsto e^{-i\langle q_0^{\flat}\xi_0,v_0\rangle}}
'''[1:-1]
L=ti.split('\n')
L.reverse()
to = '\n'.join(l+... | 17.090909 | 63 | 0.614362 |
aa5266da4c590237d4c41d6f4f6398f5593dd388 | 5,050 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations_async/_usages_operations_async.py | hurtn/azure-sdk-for-python | 64cc053e589691da22fed7a47611199818c99b2b | [
"MIT"
] | 1 | 2020-12-10T03:17:51.000Z | 2020-12-10T03:17:51.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations_async/_usages_operations_async.py | hurtn/azure-sdk-for-python | 64cc053e589691da22fed7a47611199818c99b2b | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations_async/_usages_operations_async.py | hurtn/azure-sdk-for-python | 64cc053e589691da22fed7a47611199818c99b2b | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.495495 | 146 | 0.657822 |
d020fd805cff8a4cf6b0be149389eb6450e8f3e1 | 2,005 | py | Python | tori_gazebo/src/RL/comm_test6.py | Bentell-Robotics/Tori-Robot | 838a673d65beb342b8f7a0f9589618ffbcd5ffc5 | [
"BSD-3-Clause"
] | null | null | null | tori_gazebo/src/RL/comm_test6.py | Bentell-Robotics/Tori-Robot | 838a673d65beb342b8f7a0f9589618ffbcd5ffc5 | [
"BSD-3-Clause"
] | null | null | null | tori_gazebo/src/RL/comm_test6.py | Bentell-Robotics/Tori-Robot | 838a673d65beb342b8f7a0f9589618ffbcd5ffc5 | [
"BSD-3-Clause"
] | null | null | null | import socket
import time
'''
def server():
#host = socket.gethostname() # get local machine name
host = '192.168.1.21'
port = 55444 # Make sure it's within the > 1024 $$ <65535 range
s = socket.socket()
s.bind((host, port))
s.listen(1)
client_socket, addr = s.accept()
print("Connection from: "... | 29.485294 | 80 | 0.594015 |
57dbc06ff613b1ec48eaf3c8735cc5f504d099ce | 32,324 | py | Python | pgcli/pgexecute.py | verfriemelt-dot-org/pgcli | 9678f2ab986a302fa20636b6170f34576bfebc81 | [
"BSD-3-Clause"
] | null | null | null | pgcli/pgexecute.py | verfriemelt-dot-org/pgcli | 9678f2ab986a302fa20636b6170f34576bfebc81 | [
"BSD-3-Clause"
] | null | null | null | pgcli/pgexecute.py | verfriemelt-dot-org/pgcli | 9678f2ab986a302fa20636b6170f34576bfebc81 | [
"BSD-3-Clause"
] | null | null | null | import traceback
import logging
import psycopg2
import psycopg2.extras
import psycopg2.errorcodes
import psycopg2.extensions as ext
import sqlparse
import pgspecial as special
import select
from psycopg2.extensions import POLL_OK, POLL_READ, POLL_WRITE
from .packages.parseutils.meta import FunctionMetadata, ForeignKey
... | 39.758918 | 143 | 0.543745 |
4dbf3532f0fa2b4e4cb84595757e32034ed9502e | 53,672 | py | Python | src/tests/unit/enterprise_edr/test_enterprise_edr_threatintel.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 24 | 2020-10-16T22:07:38.000Z | 2022-03-24T14:58:03.000Z | src/tests/unit/enterprise_edr/test_enterprise_edr_threatintel.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 63 | 2020-10-26T18:26:15.000Z | 2022-03-31T17:31:02.000Z | src/tests/unit/enterprise_edr/test_enterprise_edr_threatintel.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 10 | 2020-11-09T11:54:23.000Z | 2022-03-24T20:44:00.000Z | """Testing Watchlist, Report, Feed objects of cbc_sdk.enterprise_edr"""
import copy
import pytest
import logging
import re
from contextlib import ExitStack as does_not_raise
from cbc_sdk.enterprise_edr import Watchlist, Report, Feed, IOC_V2
from cbc_sdk.errors import InvalidObjectError, ApiError
from cbc_sdk.rest_api ... | 52.414063 | 119 | 0.663269 |
c08c81d3d66cbca485cf5658d55f4ffadfe52097 | 171 | py | Python | output/models/ms_data/particles/particles_ob007_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/particles/particles_ob007_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/particles/particles_ob007_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.particles.particles_ob007_xsd.particles_ob007 import (
B,
R,
Doc,
Foo,
)
__all__ = [
"B",
"R",
"Doc",
"Foo",
]
| 12.214286 | 81 | 0.555556 |
d7c36b8f127ca1c42c536409ff941a64b7571da0 | 1,387 | py | Python | cryptopals/Set4/c28.py | arvinddoraiswamy/blahblah | 1b88a04d5fa479a49ee83464ff69ba49f22c1bd0 | [
"MIT"
] | 7 | 2015-01-30T04:38:42.000Z | 2017-09-05T13:22:48.000Z | cryptopals/Set4/c28.py | arvinddoraiswamy/blahblah | 1b88a04d5fa479a49ee83464ff69ba49f22c1bd0 | [
"MIT"
] | 1 | 2017-03-12T15:48:42.000Z | 2017-03-12T15:48:42.000Z | cryptopals/Set4/c28.py | arvinddoraiswamy/blahblah | 1b88a04d5fa479a49ee83464ff69ba49f22c1bd0 | [
"MIT"
] | 5 | 2016-03-28T17:32:14.000Z | 2021-12-15T16:35:12.000Z | import sys
import os
import re
import binascii
#Adding directory to the path where Python searches for modules
cmd_folder = os.path.dirname('/home/arvind/Documents/Me/My_Projects/Git/Crypto/modules/')
sys.path.insert(0, cmd_folder)
#Importing common crypto module
import sha1
import block
message= 'this is a good tedd... | 35.564103 | 155 | 0.780101 |
8ec29a716f00764539eb25cb98a89afdda1192b5 | 9,611 | py | Python | benchmarks/coin_store.py | zcomputerwiz/littlelambocoin | ee12f3508cbee79b26aec489952743fd8599b291 | [
"Apache-2.0"
] | null | null | null | benchmarks/coin_store.py | zcomputerwiz/littlelambocoin | ee12f3508cbee79b26aec489952743fd8599b291 | [
"Apache-2.0"
] | null | null | null | benchmarks/coin_store.py | zcomputerwiz/littlelambocoin | ee12f3508cbee79b26aec489952743fd8599b291 | [
"Apache-2.0"
] | null | null | null | import asyncio
import random
from time import time
from pathlib import Path
from littlelambocoin.full_node.coin_store import CoinStore
from typing import List, Tuple
import os
import sys
from littlelambocoin.util.db_wrapper import DBWrapper
from littlelambocoin.types.blockchain_format.sized_bytes import bytes32
from l... | 30.128527 | 102 | 0.546145 |
6a7f896530323fb9cd5f83edfcae6766b42dd463 | 2,722 | py | Python | layerComparator.py | zhouzy-creator/onnx2caffe | 4e588306cdf549681f544c3dfd7686c2ed6864b8 | [
"MIT"
] | 1 | 2021-05-27T08:37:10.000Z | 2021-05-27T08:37:10.000Z | layerComparator.py | zhouzy-creator/onnx2caffe | 4e588306cdf549681f544c3dfd7686c2ed6864b8 | [
"MIT"
] | 1 | 2021-03-30T05:59:38.000Z | 2021-03-30T05:59:38.000Z | layerComparator.py | seanxcwang/onnx2caffe | 5f5cb1933316dd22f435433b65d426c6e84e520b | [
"MIT"
] | 1 | 2021-11-19T06:37:08.000Z | 2021-11-19T06:37:08.000Z | import caffe
import numpy as np
import onnx
import onnxruntime
from collections import OrderedDict
import os
dump_path = 'output/dump/layers'
if not os.path.exists(dump_path):
os.makedirs(dump_path)
def getOnnxLayerOutputs(onnx_info):
print(onnx_info)
onnx_path = onnx_info[0]
in_node = onnx_info[1]
... | 32.795181 | 73 | 0.659074 |
a3a06fc8e6075a95eaea5503bff9fddc25fdd758 | 12,964 | py | Python | cpa/gating.py | DavidStirling/CellProfiler-Analyst | 7a0bfcb5cc7db067844595bdbb90f3132f9a8ea9 | [
"MIT"
] | 98 | 2015-02-05T18:22:04.000Z | 2022-03-29T12:06:48.000Z | cpa/gating.py | DavidStirling/CellProfiler-Analyst | 7a0bfcb5cc7db067844595bdbb90f3132f9a8ea9 | [
"MIT"
] | 268 | 2015-01-14T15:43:24.000Z | 2022-02-13T22:04:37.000Z | cpa/gating.py | DavidStirling/CellProfiler-Analyst | 7a0bfcb5cc7db067844595bdbb90f3132f9a8ea9 | [
"MIT"
] | 64 | 2015-06-30T22:26:03.000Z | 2022-03-11T01:06:13.000Z |
import wx
import numpy as np
from . import sqltools as sql
from matplotlib.patches import Rectangle
from .properties import Properties
p = Properties()
class GatingHelper(object):
'''
Helper class to handle drawing and interactions with gates on 1-D and 2-D
plots.
'''
BOUNDARY_LEFT = 'left'
... | 43.503356 | 117 | 0.564409 |
b8a49fc2542206f45348c2357144d859ad0f59b6 | 866 | py | Python | Python_2/FOR e IN/programa -- Analisador.py | NicolasGandolfi/Exercicios-Python | 935fe3577c149192f9e29568e9798e970a620131 | [
"MIT"
] | null | null | null | Python_2/FOR e IN/programa -- Analisador.py | NicolasGandolfi/Exercicios-Python | 935fe3577c149192f9e29568e9798e970a620131 | [
"MIT"
] | null | null | null | Python_2/FOR e IN/programa -- Analisador.py | NicolasGandolfi/Exercicios-Python | 935fe3577c149192f9e29568e9798e970a620131 | [
"MIT"
] | null | null | null | maior=0
s=0
mulher=0
homem=0
p=0
sex=None
n=None
for i in range(1,5):
print('--------{}ª Pessoa--------'.format(i))
nome=input('Nome: ')
idade=int(input('Idade: '))
sexo=input('Sexo [M/F]: ')
s+=idade
if sexo=='M' or 'm':
sex='O HOMEM mais velho'
if sexo=='m':
homem+=... | 24.055556 | 100 | 0.51963 |
4f03cb3134e1a5522e7cd3b7c99629312125ffb0 | 684 | py | Python | nodes/1.x/python/View.CategoryIsVisible.py | andydandy74/ClockworkForDynamo | bd4ac2c13956a02352a458d01096a35b7258d9f2 | [
"MIT"
] | 147 | 2016-02-24T16:37:03.000Z | 2022-02-18T12:10:34.000Z | nodes/2.x/python/View.CategoryIsVisible.py | johnpierson/ClockworkForDynamo | 953d3f56b75e99561978925756e527357f9978dd | [
"MIT"
] | 269 | 2016-02-25T14:04:14.000Z | 2022-03-26T07:30:53.000Z | nodes/2.x/python/View.CategoryIsVisible.py | johnpierson/ClockworkForDynamo | 953d3f56b75e99561978925756e527357f9978dd | [
"MIT"
] | 89 | 2016-03-16T18:21:56.000Z | 2022-02-03T14:34:30.000Z | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
def IsCategoryVisibleInView(cat, view, version):
if version > 2016:
if view.GetCategoryHidden(cat.Id): return False
else: return True
else:
if view.GetVisibility(cat): return True
else: return False
cats = IN[0]
views = UnwrapElement(IN... | 32.571429 | 105 | 0.717836 |
bff59d60f8001c72da13f6a42fb1ccd893962679 | 16,481 | py | Python | plugins/modules/oci_key_management_key_actions.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_key_management_key_actions.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_key_management_key_actions.py | hanielburton/oci-ansible-collection | dfdffde637f746d346ba35569be8c3a3407022f2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2017, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 40.593596 | 158 | 0.636248 |
bbbdd1fc0268657070d0b0f6c9ac74899d397793 | 25,475 | py | Python | bci_framework/extensions/stimuli_delivery/path/bci_framework/extensions/stimuli_delivery/stimuli_delivery.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | bci_framework/extensions/stimuli_delivery/path/bci_framework/extensions/stimuli_delivery/stimuli_delivery.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | bci_framework/extensions/stimuli_delivery/path/bci_framework/extensions/stimuli_delivery/stimuli_delivery.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | """
================================
Visual Working Memory - Paradigm
================================
"""
import os
import json
import time
import random
import logging
from browser import timer, html, document, window
from datetime import datetime
import copy
from radiant.utils import WebSocket
from radiant.server ... | 32.998705 | 90 | 0.420687 |
efe187cc1b399114eb88eac1a7163f04e4e5acf7 | 58,940 | py | Python | sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_models_py3.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_models_py3.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/models/_models_py3.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 34.670588 | 532 | 0.620461 |
a9b4ececa6f577718737a97449d406d347bcb287 | 856 | py | Python | messageHandler.py | fargothcor/Gandalf | f5454a5583d747bbdd00d3dd5215439abe45f320 | [
"MIT"
] | null | null | null | messageHandler.py | fargothcor/Gandalf | f5454a5583d747bbdd00d3dd5215439abe45f320 | [
"MIT"
] | null | null | null | messageHandler.py | fargothcor/Gandalf | f5454a5583d747bbdd00d3dd5215439abe45f320 | [
"MIT"
] | null | null | null | from Gandalf.apiVk import sendMessage
import Gandalf.DFapi as DFapi
import os
import importlib
from Gandalf.command_class import command_list
userInCommands = {}
def load_modules():
files = os.listdir("Gandalf/commands")
modules = filter(lambda x: x.endswith('.py'), files)
for m in modules:
import... | 27.612903 | 62 | 0.648364 |
d8c66a0c502ec25034746df94e7246a4c5bf488a | 12,522 | py | Python | tests/test_index_binary.py | positive666/faiss_search | 441ccebbff480592bdc8afb9be4523e7d95466f2 | [
"MIT"
] | 1 | 2021-09-13T07:07:43.000Z | 2021-09-13T07:07:43.000Z | tests/test_index_binary.py | positive666/faiss | 441ccebbff480592bdc8afb9be4523e7d95466f2 | [
"MIT"
] | null | null | null | tests/test_index_binary.py | positive666/faiss | 441ccebbff480592bdc8afb9be4523e7d95466f2 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""this is a basic test script for simple indices work"""
from __future__ import absolute_import, division, print_function, unicode_literals
... | 29.533019 | 82 | 0.568759 |
8c87d3b3cf7e757a3b5a47a5ed368cb396a31860 | 9,687 | py | Python | corehq/form_processor/parsers/form.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/form_processor/parsers/form.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/form_processor/parsers/form.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
from contextlib import contextmanager
from couchdbkit import ResourceNotFound
from ddtrace import tracer
from corehq.apps.cloudcare.const import DEVICE_ID as FORMPLAYER_DEVICE_ID
from corehq.form_processor.interfaces.dbacce... | 41.04661 | 120 | 0.714566 |
8bac62e8ab7ab112c45a09da6514b8c29e9303ee | 8,580 | py | Python | build/docs/ModelingGuide/source/conf.py | brezillon/opensplice | 725ae9d949c83fce1746bd7d8a154b9d0a81fe3e | [
"Apache-2.0"
] | 133 | 2017-11-09T02:10:00.000Z | 2022-03-29T09:45:10.000Z | build/docs/ModelingGuide/source/conf.py | brezillon/opensplice | 725ae9d949c83fce1746bd7d8a154b9d0a81fe3e | [
"Apache-2.0"
] | 131 | 2017-11-07T14:48:43.000Z | 2022-03-13T15:30:47.000Z | build/docs/ModelingGuide/source/conf.py | brezillon/opensplice | 725ae9d949c83fce1746bd7d8a154b9d0a81fe3e | [
"Apache-2.0"
] | 94 | 2017-11-09T02:26:19.000Z | 2022-02-24T06:38:25.000Z | # -*- coding: utf-8 -*-
#
# ModelingGuide build configuration file, created by
# ReST Editor on 05-Nov-2015
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a... | 30.752688 | 101 | 0.713403 |
74899e718b8a2b3880f0df41325dd6ae9325ce10 | 301 | py | Python | mezan/school/urls.py | sjdhaneesh10/mezan | 9b9c72427c65a1bf38ae67c5d1655f8687a00494 | [
"MIT"
] | null | null | null | mezan/school/urls.py | sjdhaneesh10/mezan | 9b9c72427c65a1bf38ae67c5d1655f8687a00494 | [
"MIT"
] | null | null | null | mezan/school/urls.py | sjdhaneesh10/mezan | 9b9c72427c65a1bf38ae67c5d1655f8687a00494 | [
"MIT"
] | null | null | null | from django.urls import path,include
from rest_framework import routers
from . import views
#router = routers.DefaultRouter()
#router.register(r'masjid_list', views.MasjidViewSet)
urlpatterns = [
#path('',views.home),
path('add/', views.add),
#path('api/', include(router.urls)),
] | 21.5 | 53 | 0.697674 |
0397960699d6c74055cf378da4570a89b62e0405 | 5,253 | py | Python | cement/core/hook.py | acdaniells/cement | 1acd9fc1ae583009d281df41ac8c02053be4732f | [
"BSD-3-Clause"
] | null | null | null | cement/core/hook.py | acdaniells/cement | 1acd9fc1ae583009d281df41ac8c02053be4732f | [
"BSD-3-Clause"
] | null | null | null | cement/core/hook.py | acdaniells/cement | 1acd9fc1ae583009d281df41ac8c02053be4732f | [
"BSD-3-Clause"
] | null | null | null | """
Cement core hooks module.
"""
import operator
import types
from cement.core import exc
from cement.utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class HookManager:
"""
Manages the hook system to define, get, run, etc hooks within the
the Cement Framework and applications Built on ... | 28.241935 | 78 | 0.51799 |
4fd57c6c0f09172c0e0d511eefbea29ce024ae0e | 493 | py | Python | xmemeAPI/migrations/0002_auto_20210206_1051.py | sukanta-nandi/XMEME-Backend | a532cfca17ccde0aae9faf2a4b937644f61b9894 | [
"MIT"
] | null | null | null | xmemeAPI/migrations/0002_auto_20210206_1051.py | sukanta-nandi/XMEME-Backend | a532cfca17ccde0aae9faf2a4b937644f61b9894 | [
"MIT"
] | null | null | null | xmemeAPI/migrations/0002_auto_20210206_1051.py | sukanta-nandi/XMEME-Backend | a532cfca17ccde0aae9faf2a4b937644f61b9894 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-06 10:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('xmemeAPI', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='memedata',
old_name='username',
... | 20.541667 | 47 | 0.545639 |
34eea4832ecf93e501ff6e9fb5cb39a693023182 | 417 | py | Python | gubbins/app.py | doismellburning/django-gubbins | d94e91082adfe2ae7462209a5793b479429d40d9 | [
"BSD-2-Clause"
] | null | null | null | gubbins/app.py | doismellburning/django-gubbins | d94e91082adfe2ae7462209a5793b479429d40d9 | [
"BSD-2-Clause"
] | 4 | 2018-12-20T13:02:40.000Z | 2018-12-21T16:09:20.000Z | gubbins/app.py | doismellburning/django-gubbins | d94e91082adfe2ae7462209a5793b479429d40d9 | [
"BSD-2-Clause"
] | 2 | 2015-01-05T10:13:42.000Z | 2020-05-29T08:17:58.000Z | from django.conf.urls import include
class ReusableAppURLs(object):
def __init__(self, app_namespace, urlpatterns):
self.app_namespace = app_namespace
self.urlpatterns = urlpatterns
def __call__(self, instance_namespace=None):
instance_namespace = instance_namespace or self.app_n... | 29.785714 | 80 | 0.736211 |
d89adc0ea6998f42ea707ce31135eeb589b94369 | 5,525 | py | Python | exercises/classifiers_evaluation.py | zachoreny/IML.HUJI | 6249a79f28577bd40b529df9b6bee54561106f3c | [
"MIT"
] | null | null | null | exercises/classifiers_evaluation.py | zachoreny/IML.HUJI | 6249a79f28577bd40b529df9b6bee54561106f3c | [
"MIT"
] | null | null | null | exercises/classifiers_evaluation.py | zachoreny/IML.HUJI | 6249a79f28577bd40b529df9b6bee54561106f3c | [
"MIT"
] | null | null | null | import numpy as np
from IMLearn.learners.classifiers import Perceptron, LDA, GaussianNaiveBayes
from typing import Tuple
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from math import atan2, pi
from IMLearn.metrics import loss_functions
def load_dataset(filename: str... | 37.080537 | 123 | 0.604706 |
ef0e04477a5fe7ee3db6c79da8ae6ef869477385 | 3,320 | py | Python | src/collection/index.py | AndreMeira/py-relations | 77806e358baf39372d15ca5446423690aecf5952 | [
"MIT"
] | null | null | null | src/collection/index.py | AndreMeira/py-relations | 77806e358baf39372d15ca5446423690aecf5952 | [
"MIT"
] | null | null | null | src/collection/index.py | AndreMeira/py-relations | 77806e358baf39372d15ca5446423690aecf5952 | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import Iterable, List, Any, Dict, Callable, Union, Generic, TypeVar, Hashable
T = TypeVar('T')
IndexableGetter = Callable[[Any], Hashable]
class Index(Generic[T]):
def __init__(self, items: Iterable, index_by: Union[str, IndexableGetter]):
self.items: Iter... | 33.2 | 99 | 0.651807 |
7fb9e07d99e20212e48aea89f5484feebc32a1a5 | 1,965 | py | Python | DNNPruningPopulation.py | Felix660/DNNDeepeningPruning | 4b61ca19ebf6570fb6210d556fde89910465b691 | [
"MIT"
] | 1 | 2021-09-16T21:52:09.000Z | 2021-09-16T21:52:09.000Z | DNNPruningPopulation.py | Felix660/DNNDeepeningPruning | 4b61ca19ebf6570fb6210d556fde89910465b691 | [
"MIT"
] | 1 | 2020-12-29T13:57:40.000Z | 2020-12-29T14:11:50.000Z | DNNPruningPopulation.py | Felix660/DNNDeepeningPruning | 4b61ca19ebf6570fb6210d556fde89910465b691 | [
"MIT"
] | 1 | 2021-05-23T14:44:40.000Z | 2021-05-23T14:44:40.000Z | from DNNPruningIndividual import *
from copy import deepcopy
def get_knee_boundary_solution(Q):
for i in range(len(Q)):
if Q[i].knee_preference:
print("Saving Preferable Knee Solution: ")
Q[i].save_model()
if Q[i].boundary_heavy:
print("Saving Bounda... | 33.87931 | 119 | 0.57659 |
9d40ab189ecd214e3fb036d1a77623ab55757a93 | 1,936 | py | Python | examples/greedyhausdorff.py | siddharthsheth/greedypermutation | a9637830c3f65250a1aa02480a381cfea2f64b90 | [
"MIT"
] | 6 | 2020-12-10T10:47:43.000Z | 2021-11-04T15:37:04.000Z | examples/greedyhausdorff.py | siddharthsheth/greedypermutation | a9637830c3f65250a1aa02480a381cfea2f64b90 | [
"MIT"
] | 2 | 2021-09-01T17:24:07.000Z | 2021-09-01T17:24:14.000Z | examples/greedyhausdorff.py | siddharthsheth/greedypermutation | a9637830c3f65250a1aa02480a381cfea2f64b90 | [
"MIT"
] | 2 | 2021-07-31T11:15:06.000Z | 2021-09-02T17:33:41.000Z | """
This is an example where greedy permutations are used to improve the naive Hausdorff distance algorithm.
When computing the Hausdorff distance between 2 pointsets one of the most popular heuristic is to use
a random ordering of points and an early break.
This is an attempt to check if using a greedy ordering instea... | 31.737705 | 112 | 0.653926 |
22c197f230fc9109f08b507105a33253e75d4156 | 2,665 | py | Python | assignments/assignment8/my_evaluation.py | yy2111/fds | cb62ab644d0d8ed6586ff6b88b36be2db19b517a | [
"MIT"
] | 17 | 2020-08-05T16:47:24.000Z | 2022-02-28T19:52:49.000Z | assignments/assignment8/my_evaluation.py | yy2111/fds | cb62ab644d0d8ed6586ff6b88b36be2db19b517a | [
"MIT"
] | 98 | 2020-08-11T19:05:39.000Z | 2021-05-05T14:10:24.000Z | assignments/assignment8/my_evaluation.py | yy2111/fds | cb62ab644d0d8ed6586ff6b88b36be2db19b517a | [
"MIT"
] | 16 | 2020-08-15T12:18:16.000Z | 2021-04-08T13:53:25.000Z | import numpy as np
import pandas as pd
from collections import Counter
class my_evaluation:
# Binary class or multi-class classification evaluation
# Each data point can only belong to one class
def __init__(self, predictions, actuals, pred_proba=None):
# inputs:
# predictions: list of pre... | 35.533333 | 92 | 0.615009 |
a73677450fc742e6fa786562ab89cc233c5a372a | 12,608 | py | Python | apischema/serialization/methods.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | null | null | null | apischema/serialization/methods.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | 7 | 2022-02-28T02:37:58.000Z | 2022-03-31T02:31:32.000Z | apischema/serialization/methods.py | wyfo/apimodel | 99e6b23504e8ca775fda9dfa93c4e350211c1b8a | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import AbstractSet, Any, Callable, Dict, Optional, Tuple, Union
from apischema.conversions.utils import Converter
from apischema.fields import FIELDS_SET_ATTR
from apischema.serialization.errors import TypeCheckError
from apischema.types import AnyType, Undefined
fr... | 30.380723 | 88 | 0.657678 |
faaf975b5f2fab49b72127fbfd31e2ccd7802e3d | 7,417 | py | Python | Chapter03/wifi_lookup.py | khanhnnvn/Python-Digital-Forensics-Cookbook | 97d1de3d84e25bcc1211024b2b5077d7777c0427 | [
"MIT"
] | 58 | 2017-09-29T12:35:57.000Z | 2022-03-17T11:32:07.000Z | Chapter03/wifi_lookup.py | herculosh/Python-Digital-Forensics-Cookbook | 7f0ee63a16b4da472bdcb75379e7e3ba4ed72fd1 | [
"MIT"
] | null | null | null | Chapter03/wifi_lookup.py | herculosh/Python-Digital-Forensics-Cookbook | 7f0ee63a16b4da472bdcb75379e7e3ba4ed72fd1 | [
"MIT"
] | 38 | 2017-09-28T22:03:22.000Z | 2022-03-28T12:04:01.000Z | from __future__ import print_function
import argparse
import csv
import os
import sys
import xml.etree.ElementTree as ET
import requests
"""
MIT License
Copyright (c) 2017 Chapin Bryce, Preston Miller
Please share comments and questions at:
https://github.com/PythonForensics/PythonForensicsCookbook
or email ... | 37.841837 | 78 | 0.575165 |
d036253fbabeb6ca51152d0940a0cec98718b025 | 1,854 | py | Python | tests/test_data/packages/example.com/example.com-transforms/pylib/__init__.py | Metatab/metapack-build | 9311e1377a3e928ad4660c1a4cc174395b68d071 | [
"MIT"
] | null | null | null | tests/test_data/packages/example.com/example.com-transforms/pylib/__init__.py | Metatab/metapack-build | 9311e1377a3e928ad4660c1a4cc174395b68d071 | [
"MIT"
] | 1 | 2019-07-02T04:49:02.000Z | 2019-07-02T04:49:02.000Z | tests/test_data/packages/example.com/example.com-transforms/pylib/__init__.py | Metatab/metapack-build | 9311e1377a3e928ad4660c1a4cc174395b68d071 | [
"MIT"
] | null | null | null | from datetime import date, datetime, time
from math import pi
from random import randint, random
from geoid.acs import Tract
from geoid.census import CensusGeoid
from geoid.tiger import TigerGeoid
def doubleit(v):
return 2 * v
def row_generator(resource, doc, env, *args, **kwargs):
""" An example row gener... | 28.96875 | 105 | 0.641316 |
a1a86226f88e179bfc9e30e460e0d10abc582e52 | 306 | py | Python | TMonline/TM/views.py | KAN-RYU/TerraformingMarsPython | 7a689d8ef994b98df0f3c2ec18d150d11daeda59 | [
"MIT"
] | 1 | 2019-01-09T03:42:34.000Z | 2019-01-09T03:42:34.000Z | TMonline/TM/views.py | KAN-RYU/TerraformingMarsPython | 7a689d8ef994b98df0f3c2ec18d150d11daeda59 | [
"MIT"
] | null | null | null | TMonline/TM/views.py | KAN-RYU/TerraformingMarsPython | 7a689d8ef994b98df0f3c2ec18d150d11daeda59 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic import ListView, DetailView, TemplateView
from TM.models import TM
# Create your views here.
class TmList(ListView):
model = TM
class TmDetail(DetailView):
model = TM
class TmGrid(TemplateView):
template_name = "TM/tm_grid.html"
| 21.857143 | 67 | 0.761438 |
b8b2f0f0fdcc504db42c5ecf4661fce453722c32 | 9,350 | py | Python | src/cirrus/build.py | cloudant/cirrus | 2ac29853e877a8672fbbc582c914301a0c9c9ed9 | [
"Apache-2.0"
] | 1 | 2018-06-07T21:28:22.000Z | 2018-06-07T21:28:22.000Z | src/cirrus/build.py | cloudant/cirrus | 2ac29853e877a8672fbbc582c914301a0c9c9ed9 | [
"Apache-2.0"
] | 6 | 2018-02-21T20:49:34.000Z | 2019-08-15T19:42:49.000Z | src/cirrus/build.py | cloudant/cirrus | 2ac29853e877a8672fbbc582c914301a0c9c9ed9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
_build_
Implements the cirrus build command.
This command:
- creates a virtualenv in the package
- pip installs requirements.txt for the package into the venv
"""
import os
import sys
from argparse import ArgumentParser
from cirrus.documentation_utils import build_docs
from cirrus.enviro... | 29.68254 | 77 | 0.586845 |
9a57ca119240ca4a7d8350db999a23fd53b62c2d | 1,410 | py | Python | cords/utils/models/cnn.py | krishnatejakk/AUTOMATA | fd0cf58058e39660f88d9d6b4101e30a497f6ce2 | [
"MIT"
] | 185 | 2021-01-15T20:28:19.000Z | 2022-03-31T16:13:29.000Z | cords/utils/models/cnn.py | krishnatejakk/AUTOMATA | fd0cf58058e39660f88d9d6b4101e30a497f6ce2 | [
"MIT"
] | 36 | 2021-02-25T17:57:21.000Z | 2022-03-25T03:12:16.000Z | cords/utils/models/cnn.py | krishnatejakk/AUTOMATA | fd0cf58058e39660f88d9d6b4101e30a497f6ce2 | [
"MIT"
] | 31 | 2021-01-04T00:39:59.000Z | 2022-03-24T22:08:12.000Z | import torch
import torch.nn as nn
from .utils import param_init
class CNN(nn.Module):
def __init__(self, n_out):
super(CNN, self).__init__()
self.conv = nn.Sequential(nn.Conv2d(1, 16, 3, padding=1),
nn.MaxPool2d(3, stride=2, padding=1),
... | 32.045455 | 77 | 0.441135 |
075cf36f649b59e450dd00ec04a4b2d255eeedcb | 2,212 | py | Python | src/spaceone/inventory/connector/aws_kinesis_firehose_connector/schema/service_type.py | jean1042/plugin-aws-cloud-services | 1cf192557b03478af33ae81f40b2a49f735716bb | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/connector/aws_kinesis_firehose_connector/schema/service_type.py | jean1042/plugin-aws-cloud-services | 1cf192557b03478af33ae81f40b2a49f735716bb | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/connector/aws_kinesis_firehose_connector/schema/service_type.py | jean1042/plugin-aws-cloud-services | 1cf192557b03478af33ae81f40b2a49f735716bb | [
"Apache-2.0"
] | null | null | null | from spaceone.inventory.libs.schema.dynamic_field import TextDyField, EnumDyField, SearchField, DateTimeDyField
from spaceone.inventory.libs.schema.resource import CloudServiceTypeResource, CloudServiceTypeResponse, \
CloudServiceTypeMeta
cst_firehose = CloudServiceTypeResource()
cst_firehose.name = "DeliveryStrea... | 46.083333 | 154 | 0.714286 |
bf4ba6cb6819275f866bcc69ffdb85a54b0f0a49 | 13,334 | py | Python | skyfield/sgp4lib.py | zanzibar7/python-skyfield | 332038d49ea5814061336cd70cad1d819e630f2b | [
"MIT"
] | null | null | null | skyfield/sgp4lib.py | zanzibar7/python-skyfield | 332038d49ea5814061336cd70cad1d819e630f2b | [
"MIT"
] | null | null | null | skyfield/sgp4lib.py | zanzibar7/python-skyfield | 332038d49ea5814061336cd70cad1d819e630f2b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""An interface between Skyfield and the Python ``sgp4`` library."""
from numpy import (
array, concatenate, identity, multiply, ones_like, repeat,
)
from sgp4.api import SGP4_ERRORS, Satrec
from .constants import AU_KM, DAY_S, T0, tau
from .framelib import itrs
from .functions import _T, ... | 37.880682 | 79 | 0.631993 |
4a056158abac281a805223304d5067ea5d8f11ac | 208 | py | Python | trials_colab/stack_gan_trials/main.py | bkemmer/GSoC-TensorFlow-2019 | 9bde2939ee073504630e2810496aae3618b5afa2 | [
"Apache-2.0"
] | 5 | 2021-07-08T15:49:58.000Z | 2022-03-15T11:18:57.000Z | trials_colab/stack_gan_trials/main.py | bkemmer/GSoC-TensorFlow-2019 | 9bde2939ee073504630e2810496aae3618b5afa2 | [
"Apache-2.0"
] | 13 | 2021-04-25T03:32:53.000Z | 2022-03-11T23:53:16.000Z | trials_colab/stack_gan_trials/main.py | bkemmer/GSoC-TensorFlow-2019 | 9bde2939ee073504630e2810496aae3618b5afa2 | [
"Apache-2.0"
] | 8 | 2021-03-08T17:20:43.000Z | 2022-03-15T11:24:03.000Z | # Runner Code
# TODO: Train Stage 1
# TODO: Train Stage 2
import model as stack_gan
# stage1 = stack_gan.StackGanStage1()
# stage1.train_stage1()
stage2 = stack_gan.StackGanStage2()
stage2.train_stage2()
| 17.333333 | 37 | 0.75 |
2cfcdeaada36b3d0da06d701613443767fa34fc4 | 1,090 | py | Python | tests/test_args.py | jmp/react-native-bundle-extractor | 5ac85639577987dc8303c16f1bcb65f4651b14c6 | [
"MIT"
] | 10 | 2020-02-12T12:12:02.000Z | 2021-11-23T06:24:03.000Z | tests/test_args.py | jmp/react-native-bundle-extractor | 5ac85639577987dc8303c16f1bcb65f4651b14c6 | [
"MIT"
] | null | null | null | tests/test_args.py | jmp/react-native-bundle-extractor | 5ac85639577987dc8303c16f1bcb65f4651b14c6 | [
"MIT"
] | 1 | 2022-03-12T12:13:50.000Z | 2022-03-12T12:13:50.000Z | import pytest
from extractor.args import parse_args
def test_parse_args_exits_with_usage_if_invalid_arguments(capsys):
with pytest.raises(SystemExit):
parse_args([])
captured = capsys.readouterr()
assert captured.err.startswith("usage:")
def test_parse_args_takes_apk_or_package_as_first_argumen... | 26.585366 | 66 | 0.727523 |
9c436444a049f3f53a5a49febc909723cb44f8de | 8,709 | py | Python | wechat_django/models/messagehandler.py | cnbillow/wechat-django | fe7c35b6c716599a1deb30f04a38699670c20a90 | [
"MIT"
] | null | null | null | wechat_django/models/messagehandler.py | cnbillow/wechat-django | fe7c35b6c716599a1deb30f04a38699670c20a90 | [
"MIT"
] | null | null | null | wechat_django/models/messagehandler.py | cnbillow/wechat-django | fe7c35b6c716599a1deb30f04a38699670c20a90 | [
"MIT"
] | 1 | 2019-09-24T08:19:31.000Z | 2019-09-24T08:19:31.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import random
from django.db import models as m, transaction
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from wechatpy.exceptions import WeChatClientException
from ..exceptions import MessageH... | 33.367816 | 79 | 0.547594 |
7470e218411e8801878940b1b4f471ea4544361a | 2,482 | py | Python | cogs/addPointToSpaceShip.py | BioKZM/Colonist | ab3872c01b1bdc235e80065530fbed9953952919 | [
"MIT"
] | 5 | 2021-11-20T12:30:55.000Z | 2022-02-02T15:34:23.000Z | cogs/addPointToSpaceShip.py | BioKZM/Colonist | ab3872c01b1bdc235e80065530fbed9953952919 | [
"MIT"
] | null | null | null | cogs/addPointToSpaceShip.py | BioKZM/Colonist | ab3872c01b1bdc235e80065530fbed9953952919 | [
"MIT"
] | null | null | null | import discord
from discord.utils import get
from discord.ext import commands
from discord_slash.utils.manage_commands import create_choice, create_option
from discord_slash import SlashContext, cog_ext
from main import guildID
from functions.userClass import User
class AddPointToSpaceShip(commands.Cog):
def __i... | 34.957746 | 168 | 0.521757 |
826c774ad533827fde8dc0063206a1f96a89d11e | 956 | py | Python | ch07.py | duckbill360/hands-on-ml | 5cba5a6f245e113ccf76c7c124add2daf0573ca7 | [
"Apache-2.0"
] | null | null | null | ch07.py | duckbill360/hands-on-ml | 5cba5a6f245e113ccf76c7c124add2daf0573ca7 | [
"Apache-2.0"
] | null | null | null | ch07.py | duckbill360/hands-on-ml | 5cba5a6f245e113ccf76c7c124add2daf0573ca7 | [
"Apache-2.0"
] | null | null | null | # ch07
# Ensemble Learning
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import VotingClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
log_clf = LogisticRegression()
rnd_clf = RandomForestClassifier()
svm_clf = SVC(probability=True)
voting_clf = Vo... | 25.157895 | 100 | 0.75523 |
e805896685a1622b8ce6657080e1ae25b8852bf3 | 360 | py | Python | lshash/__init__.py | hens01/test | 18fa957d75bc04ef8e5eb720853ef1c0863c2206 | [
"MIT"
] | 469 | 2016-11-17T06:14:28.000Z | 2022-03-29T03:08:48.000Z | lshash/__init__.py | hens01/test | 18fa957d75bc04ef8e5eb720853ef1c0863c2206 | [
"MIT"
] | 19 | 2017-04-07T19:26:00.000Z | 2021-05-24T12:17:04.000Z | lshash/__init__.py | hens01/test | 18fa957d75bc04ef8e5eb720853ef1c0863c2206 | [
"MIT"
] | 121 | 2016-11-09T01:05:31.000Z | 2022-02-12T19:55:04.000Z | # lshash/__init__.py
# Copyright 2012 Kay Zhu (a.k.a He Zhu) and contributors (see CONTRIBUTORS.txt)
#
# This module is part of lshash and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__title__ = 'lshash'
__author__ = 'Kay Zhu (me@kayzhu.com)'
__license__ = 'MIT'
__version__ ... | 27.692308 | 79 | 0.741667 |
a5b5d3ae73ac018558c69acb8acd93e4d4d387ba | 638 | py | Python | 1simple linear regression.py | CrazyFox-001/ML | b5cb833cc945b1a039521d4e33aa0f6a099671e0 | [
"Apache-2.0"
] | null | null | null | 1simple linear regression.py | CrazyFox-001/ML | b5cb833cc945b1a039521d4e33aa0f6a099671e0 | [
"Apache-2.0"
] | null | null | null | 1simple linear regression.py | CrazyFox-001/ML | b5cb833cc945b1a039521d4e33aa0f6a099671e0 | [
"Apache-2.0"
] | null | null | null | import pandas as ps
import numpy as np
import matplotlib.pyplot as mb
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
data = ps.read_csv('busfare.csv')
X = data.iloc[:, :-1].values
Y = data.iloc[:, 1].values
training_x, test_x, traning_y, test_y = tra... | 23.62963 | 78 | 0.710031 |
e963263f3ecfd890c24e23c6f927faa118afa5f5 | 1,049 | py | Python | ant-tools.py | sequencing/ant-tools | bdd99714d9db7a2001362c18deff7b2ddc724080 | [
"BSD-2-Clause"
] | null | null | null | ant-tools.py | sequencing/ant-tools | bdd99714d9db7a2001362c18deff7b2ddc724080 | [
"BSD-2-Clause"
] | null | null | null | ant-tools.py | sequencing/ant-tools | bdd99714d9db7a2001362c18deff7b2ddc724080 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import io, os, sys, json
from subprocess import Popen, PIPE
BIN = "ant-tools"
class AntReader(object):
def __init__(self, ant_path):
if not ant_path:
raise Exception("An .ant file must be specified")
self.ant_path = ant_path
def Load(self):
for line in call_bin(get_bin... | 19.072727 | 72 | 0.653003 |
1d7448973cd29fbe3db5bc50bcf33de2ca7e56a9 | 5,096 | py | Python | PPDyn/ppdyn.py | rinku-mishra/PPDyn | b9e255e673998b9dc9f9753efa44c0c036020bf4 | [
"MIT"
] | 2 | 2021-03-20T23:15:42.000Z | 2021-04-30T14:46:45.000Z | PPDyn/ppdyn.py | rinku-mishra/PPDyn | b9e255e673998b9dc9f9753efa44c0c036020bf4 | [
"MIT"
] | 20 | 2021-03-25T10:59:29.000Z | 2021-06-15T21:46:09.000Z | PPDyn/ppdyn.py | rinku-mishra/PPDyn | b9e255e673998b9dc9f9753efa44c0c036020bf4 | [
"MIT"
] | 2 | 2021-03-21T12:20:43.000Z | 2021-06-14T11:11:59.000Z | #!/usr/bin/env python
"""
** Plasma Particle Dynamics (PPDyn) **
@file main.py
@authors Sayan Adhikari <sayan.adhikari@fys.uio.no>
Rupak Mukherjee <rupakm@princeton.edu>
@date 17.03.2021
"""
import numpy as np
from numba import jit
import h5py
import t... | 38.900763 | 111 | 0.574568 |
6e9854b490e9fd532355e07ff3033f8136aa22be | 122 | py | Python | sept_example/sept_example.py | dilnoza92/sept_example | e31dde5e53ae2813b39583d242e732b04528a334 | [
"MIT"
] | null | null | null | sept_example/sept_example.py | dilnoza92/sept_example | e31dde5e53ae2813b39583d242e732b04528a334 | [
"MIT"
] | null | null | null | sept_example/sept_example.py | dilnoza92/sept_example | e31dde5e53ae2813b39583d242e732b04528a334 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Main module."""
a=4
b=5
def addition(var1,var2):
return var1+var2
c=addition(a,b)
print c
| 12.2 | 24 | 0.606557 |
221a43fd4b41a97ff5cf9614195a9ace6ec042db | 1,658 | py | Python | recipes/Python/362879_Watermark_with_PIL/recipe-362879.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/362879_Watermark_with_PIL/recipe-362879.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/362879_Watermark_with_PIL/recipe-362879.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | import Image, ImageEnhance
def reduce_opacity(im, opacity):
"""Returns an image with reduced opacity."""
assert opacity >= 0 and opacity <= 1
if im.mode != 'RGBA':
im = im.convert('RGBA')
else:
im = im.copy()
alpha = im.split()[3]
alpha = ImageEnhance.Brightness(alpha).enhance(o... | 33.16 | 79 | 0.574789 |
0f7061c4d264abadfc2ffc9514c86fa8ccef1a81 | 4,596 | py | Python | tests/test_markup.py | msaroufim/rich | 51165f4b21e2b3af896eca750ae6a080fc4d7cf5 | [
"MIT"
] | null | null | null | tests/test_markup.py | msaroufim/rich | 51165f4b21e2b3af896eca750ae6a080fc4d7cf5 | [
"MIT"
] | 23 | 2021-07-05T01:25:33.000Z | 2022-03-28T01:30:36.000Z | tests/test_markup.py | ewels/rich | 03b2c71193bc62a6e25bfff48fe7ea218c2cb57c | [
"MIT"
] | null | null | null | import pytest
from rich.console import Console
from rich.markup import escape, MarkupError, _parse, render, Tag, RE_TAGS
from rich.text import Span
def test_re_no_match():
assert RE_TAGS.match("[True]") == None
assert RE_TAGS.match("[False]") == None
assert RE_TAGS.match("[None]") == None
assert RE_T... | 27.686747 | 84 | 0.588773 |
5305e33a6e78739bd4f4f045544b565780fdc8be | 266 | py | Python | kubernetes_typed/client/models/v1beta1_endpoint_conditions.py | sobolevn/kubernetes-typed | 5f0a770631c73a9831fbeaeebac188e8f4a52c54 | [
"Apache-2.0"
] | 22 | 2020-12-10T13:06:02.000Z | 2022-02-13T21:58:15.000Z | kubernetes_typed/client/models/v1beta1_endpoint_conditions.py | sobolevn/kubernetes-typed | 5f0a770631c73a9831fbeaeebac188e8f4a52c54 | [
"Apache-2.0"
] | 4 | 2021-03-08T07:06:12.000Z | 2022-03-29T23:41:45.000Z | kubernetes_typed/client/models/v1beta1_endpoint_conditions.py | sobolevn/kubernetes-typed | 5f0a770631c73a9831fbeaeebac188e8f4a52c54 | [
"Apache-2.0"
] | 2 | 2021-09-05T19:18:28.000Z | 2022-03-14T02:56:17.000Z | # Code generated by `typeddictgen`. DO NOT EDIT.
"""V1beta1EndpointConditionsDict generated type."""
from typing import TypedDict
V1beta1EndpointConditionsDict = TypedDict(
"V1beta1EndpointConditionsDict",
{
"ready": bool,
},
total=False,
)
| 22.166667 | 51 | 0.710526 |
6b3d1d3f1857cd81d7e7f4a612c46f31b955a811 | 7,158 | py | Python | evaluate.py | thoang3/tensorflow-yolov3 | 2ae6a0d8d5fb5bc250002415a62dcd5e9d400a2c | [
"MIT"
] | null | null | null | evaluate.py | thoang3/tensorflow-yolov3 | 2ae6a0d8d5fb5bc250002415a62dcd5e9d400a2c | [
"MIT"
] | null | null | null | evaluate.py | thoang3/tensorflow-yolov3 | 2ae6a0d8d5fb5bc250002415a62dcd5e9d400a2c | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
#================================================================
# Copyright (C) 2019 * Ltd. All rights reserved.
#
# Editor : VIM
# File name : evaluate.py
# Author : YunYang1994
# Created date: 2019-02-21 15:30:26
# Description :
#
#======================... | 43.120482 | 112 | 0.566639 |
a1bd7c6bfa24d76ed9c9642e70b0f33e0c20c87d | 5,180 | py | Python | shadowsocks/server_pool.py | ovear/shadowsocks | 1c32446f1adf6e50bed65fb4baf28d22431ed7e6 | [
"MIT"
] | 10 | 2015-01-11T13:26:25.000Z | 2016-04-16T04:58:48.000Z | shadowsocks/server_pool.py | ShenXuGongZi/shadowsocks | 1c32446f1adf6e50bed65fb4baf28d22431ed7e6 | [
"MIT"
] | null | null | null | shadowsocks/server_pool.py | ShenXuGongZi/shadowsocks | 1c32446f1adf6e50bed65fb4baf28d22431ed7e6 | [
"MIT"
] | 1 | 2021-04-23T12:36:32.000Z | 2021-04-23T12:36:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | 35.724138 | 124 | 0.622201 |
3870a202e2c5e5744ed66bd77ac7e4de4166a84b | 1,144 | py | Python | project/migrations/versions/3e53def25421_rename_table.py | Firdaus212/pjb | 5984858003db8d3b58ed6269a1276e694ac57b5b | [
"Apache-2.0"
] | null | null | null | project/migrations/versions/3e53def25421_rename_table.py | Firdaus212/pjb | 5984858003db8d3b58ed6269a1276e694ac57b5b | [
"Apache-2.0"
] | null | null | null | project/migrations/versions/3e53def25421_rename_table.py | Firdaus212/pjb | 5984858003db8d3b58ed6269a1276e694ac57b5b | [
"Apache-2.0"
] | null | null | null | """Rename Table
Revision ID: 3e53def25421
Revises: 188616a9b6c1
Create Date: 2021-02-04 20:20:31.607029
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3e53def25421'
down_revision = '188616a9b6c1'
branch_labels = None
depends_on = None
def upgrade():
# #... | 26.604651 | 65 | 0.661713 |
ab396dfc2acddb0e6689659cc2939209e747b867 | 550 | py | Python | data_util.py | huji0624/data_analyze_course | 96e700004d0c9643d55735498049e724f029476d | [
"MIT"
] | null | null | null | data_util.py | huji0624/data_analyze_course | 96e700004d0c9643d55735498049e724f029476d | [
"MIT"
] | null | null | null | data_util.py | huji0624/data_analyze_course | 96e700004d0c9643d55735498049e724f029476d | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['axes.grid'] = True
def filter(tdf,evlist):
laststep = None
filters = []
for ev in evlist:
if laststep is not None:
t = tdf[tdf['event_name']==ev].drop_duplicates("id")
step = t[t['id'].isin... | 25 | 68 | 0.574545 |
e2df4c3de7777b3d00a49009a1c876bc19d1e410 | 386 | py | Python | app/pico/wsgi.py | uva-slp/pico | 3a4f20ea5e9359e2e4b770442fa59ae8e0bf30ed | [
"MIT"
] | 1 | 2017-09-20T23:29:59.000Z | 2017-09-20T23:29:59.000Z | app/pico/wsgi.py | uva-slp/pico | 3a4f20ea5e9359e2e4b770442fa59ae8e0bf30ed | [
"MIT"
] | null | null | null | app/pico/wsgi.py | uva-slp/pico | 3a4f20ea5e9359e2e4b770442fa59ae8e0bf30ed | [
"MIT"
] | null | null | null | """
WSGI config for pico project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTING... | 22.705882 | 78 | 0.782383 |
a9eb6d6fe5dfbe62011d4a33f17bcf3673ae5893 | 2,919 | py | Python | jmeter_api/timers/uniform_random_timer/elements.py | dashawn888/jmeter_api | 1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd | [
"Apache-2.0"
] | 11 | 2020-03-22T13:30:21.000Z | 2021-12-25T06:23:44.000Z | jmeter_api/timers/uniform_random_timer/elements.py | dashawn888/jmeter_api | 1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd | [
"Apache-2.0"
] | 37 | 2019-12-18T13:12:50.000Z | 2022-02-10T10:52:37.000Z | jmeter_api/timers/uniform_random_timer/elements.py | dashawn888/jmeter_api | 1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd | [
"Apache-2.0"
] | 5 | 2019-12-06T10:55:56.000Z | 2020-06-01T19:32:32.000Z | from jmeter_api.basics.timer.elements import BasicTimer
from jmeter_api.basics.utils import Renderable, tree_to_str
class UniformRandTimer(BasicTimer, Renderable):
"""
Uniform random timer class.
(Capslock means arguments)
Let you create uniform timer instance with name, constant offset delay and ran... | 39.445946 | 109 | 0.613224 |
9bdbea877957da1328b0ed49650b83b40cbcaa2d | 3,491 | py | Python | bindings/python/ensmallen/datasets/string/bacilluscaseinilyticus.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/bacilluscaseinilyticus.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/bacilluscaseinilyticus.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Bacillus caseinilyticus.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protei... | 33.247619 | 223 | 0.679461 |
6a32d8c8d7d7fbb1a08c3d6b17caca34891cf8fb | 1,792 | py | Python | tests/group/test_options.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/group/test_options.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/group/test_options.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest.mock
import pytest
import pycamunda.group
import pycamunda.resource
from tests.mock import raise_requests_exception_mock, not_ok_response_mock
def test_options_params(engine_url):
group_options = pycamunda.group.Options(url=engine_url, id_='anId')
assert group_optio... | 33.811321 | 90 | 0.775112 |
552b268420749f85d57ad60599d5293b36e0c569 | 452 | py | Python | guery_manager/queries/migrations/0002_queries_dataset.py | BigQueryManager/bigquerymgr | edf98fae4b5207cb5b75deb06a53708a5f13b10f | [
"MIT"
] | 1 | 2017-07-24T15:46:55.000Z | 2017-07-24T15:46:55.000Z | guery_manager/queries/migrations/0002_queries_dataset.py | BigQueryManager/bigquerymgr | edf98fae4b5207cb5b75deb06a53708a5f13b10f | [
"MIT"
] | 5 | 2020-02-11T23:57:11.000Z | 2021-12-13T19:45:41.000Z | guery_manager/queries/migrations/0002_queries_dataset.py | BigQueryManager/bigquerymgr | edf98fae4b5207cb5b75deb06a53708a5f13b10f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-26 17:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('queries', '0001_initial'),
]
operations = [
migrations.AddField(
... | 21.52381 | 62 | 0.610619 |
6b5a25e2583367babb3ae3408edc880d433f8c00 | 460 | py | Python | poem/Poem/poem/migrations/0015_nounique_userprofile.py | ARGOeu/poem-react-ui | f21ceddf53471fd947d8a296d629782e61489b91 | [
"Apache-2.0"
] | null | null | null | poem/Poem/poem/migrations/0015_nounique_userprofile.py | ARGOeu/poem-react-ui | f21ceddf53471fd947d8a296d629782e61489b91 | [
"Apache-2.0"
] | 139 | 2020-04-06T09:22:16.000Z | 2021-08-02T06:39:22.000Z | poem/Poem/poem/migrations/0015_nounique_userprofile.py | vrdel/poem-2 | 42672fc066b71b4958168d8031e1da0043ac6d1f | [
"Apache-2.0"
] | 3 | 2019-07-10T09:37:38.000Z | 2020-04-02T10:48:38.000Z | # Generated by Django 2.2.12 on 2020-05-07 10:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('poem', '0014_metric_profile_description_blank'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | 24.210526 | 108 | 0.63913 |
ca4948493f9bb4575c647040f0c6e336ee00a761 | 229 | py | Python | docs/user_guide/operation/scripts/examples/argus/extraction/jan/WaitForMiniboneAccess.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | docs/user_guide/operation/scripts/examples/argus/extraction/jan/WaitForMiniboneAccess.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | docs/user_guide/operation/scripts/examples/argus/extraction/jan/WaitForMiniboneAccess.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | def main():
info('Waiting for minibone access')
wait('FelixMiniboneFlag', 0)
info('Minibone free')
acquire('JanMiniboneFlag', clear=True)
info('Minibone acquired')
wait('MinibonePumpTimeFlag', 0)
| 25.444444 | 42 | 0.650655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.