max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
tfkstbd/tests/test_check.py
shkarupa-alex/tfstbd
0
6632451
<filename>tfkstbd/tests/test_check.py # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest from collections import Counter from ..check import mean_waste, estimate_buckets, estimate_batches class TestMeaningWaste(unittest...
<filename>tfkstbd/tests/test_check.py # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest from collections import Counter from ..check import mean_waste, estimate_buckets, estimate_batches class TestMeaningWaste(unittest...
en
0.769321
# -*- coding: utf-8 -*-
2.428773
2
launch/drone_sim.launch.py
slaghuis/drone_mavsdk
2
6632452
<filename>launch/drone_sim.launch.py from launch import LaunchDescription from launch_ros.actions import Node def generate_launch_description(): ld = LaunchDescription() map_odom_tf = Node( package='tf2_ros', executable='static_transform_publisher', arguments=['0','0','0','0','0',...
<filename>launch/drone_sim.launch.py from launch import LaunchDescription from launch_ros.actions import Node def generate_launch_description(): ld = LaunchDescription() map_odom_tf = Node( package='tf2_ros', executable='static_transform_publisher', arguments=['0','0','0','0','0',...
none
1
2.411631
2
tests/test_51_client.py
cmurphy/pysaml2
0
6632453
#!/usr/bin/env python # -*- coding: utf-8 -*- import base64 import uuid import six from future.backports.urllib.parse import parse_qs from future.backports.urllib.parse import urlencode from future.backports.urllib.parse import urlparse from pytest import raises from saml2.argtree import add_path from saml2.cert impo...
#!/usr/bin/env python # -*- coding: utf-8 -*- import base64 import uuid import six from future.backports.urllib.parse import parse_qs from future.backports.urllib.parse import urlencode from future.backports.urllib.parse import urlparse from pytest import raises from saml2.argtree import add_path from saml2.cert impo...
en
0.61638
#!/usr/bin/env python # -*- coding: utf-8 -*- # Sometimes we get an xml header, sometimes we don't. # Check name_format ?? <?xml version='1.0' encoding='UTF-8'?> <ns0:AttributeQuery Destination="https://idp.example.com/idp/" ID="id1" IssueInstant="%s" Version="2.0" xmlns:ns0="urn:oasis:names:tc:SAML:2 .0:protocol"><ns1...
1.429538
1
xicam/SAXS/tests/test_workflows.py
ihumphrey/Xi-cam.SAXS
1
6632454
<filename>xicam/SAXS/tests/test_workflows.py from collections import namedtuple import fabio import numpy as np from pyFAI import detectors, calibrant from pyFAI.azimuthalIntegrator import AzimuthalIntegrator import pytest from xicam.core import execution from xicam.core.execution import localexecutor from xicam.SAXS...
<filename>xicam/SAXS/tests/test_workflows.py from collections import namedtuple import fabio import numpy as np from pyFAI import detectors, calibrant from pyFAI.azimuthalIntegrator import AzimuthalIntegrator import pytest from xicam.core import execution from xicam.core.execution import localexecutor from xicam.SAXS...
en
0.829431
# TODO should dark correction be required?
2.152318
2
fixit/common/report.py
Instagram/Fix
0
6632455
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import abc import ast from pathlib import Path from pickle import PicklingError from typing import Collection, Optional, Sequence, Union impo...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import abc import ast from pathlib import Path from pickle import PicklingError from typing import Collection, Optional, Sequence, Union impo...
en
0.914426
# 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. Represents a lint violation. This is generated by calling `self.context.report` in your lint rule, and is saved to the context's `reports` ...
2.453962
2
lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py
acidburn0zzz/llvm-project
2
6632456
<filename>lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py import gdbremote_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemoteMemoryTagging(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = Tes...
<filename>lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py import gdbremote_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemoteMemoryTagging(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = Tes...
en
0.886867
#00".format(body), #00".format(expected), Test that qMemTags packets are parsed correctly and/or rejected. # Run the process # Start running after initial stop #63", # Match the address of the MTE page # Now stop the inferior # And wait for the stop notification # Run the packet stream # nil means we couldn't set up a ...
1.971064
2
things/BOTUTL.py
BananasCanCodeToo/Acron-Discord-Bot
3
6632457
import discord import datetime import json import pickle import yaml from discord.ext import commands, tasks from discord import Embed, Member from datetime import timedelta from itertools import cycle import things.UTILITIES as utl async def startgame(user, code, guild, bot): x = datetime.datetime.now() game...
import discord import datetime import json import pickle import yaml from discord.ext import commands, tasks from discord import Embed, Member from datetime import timedelta from itertools import cycle import things.UTILITIES as utl async def startgame(user, code, guild, bot): x = datetime.datetime.now() game...
en
0.830078
# looks to see if this player already has a game # Sends game code #{user.discriminator}',icon_url=f'{user.avatar_url}') # Writes the game to the Game JSON file # Opens game file to find message ID and game code # Gets the message ID and game code # Removes game from games.json # Gets the message from the ID # Edits th...
2.729856
3
Data Structures and Algorithms/HackerRank Algo Solutions/EASY PROBLEMS/BirthdayCakeCandles.py
akkik04/Python-DataStructures-and-Algorithms
1
6632458
<filename>Data Structures and Algorithms/HackerRank Algo Solutions/EASY PROBLEMS/BirthdayCakeCandles.py # BIRTHDAY CAKE CANDLES HACKER-RANK SOLUTION: # function receiving an argument as the candles array. def birthdayCakeCandles(candles): # declaring a variable to store the length of the candle array. x...
<filename>Data Structures and Algorithms/HackerRank Algo Solutions/EASY PROBLEMS/BirthdayCakeCandles.py # BIRTHDAY CAKE CANDLES HACKER-RANK SOLUTION: # function receiving an argument as the candles array. def birthdayCakeCandles(candles): # declaring a variable to store the length of the candle array. x...
en
0.793482
# BIRTHDAY CAKE CANDLES HACKER-RANK SOLUTION: # function receiving an argument as the candles array. # declaring a variable to store the length of the candle array. # declaring variables for the count and the maximum number. # for-loop to iterate for the length of the candle array. # nested if-statement to determine if...
4.306523
4
custom/icds_reports/management/commands/migrate_ucr.py
kkrampa/commcare-hq
1
6632459
from __future__ import absolute_import, print_function from __future__ import unicode_literals from datetime import date, datetime from dateutil.relativedelta import relativedelta from django.core.management.base import BaseCommand from sqlalchemy import select from corehq.apps.userreports.models import get_datasour...
from __future__ import absolute_import, print_function from __future__ import unicode_literals from datetime import date, datetime from dateutil.relativedelta import relativedelta from django.core.management.base import BaseCommand from sqlalchemy import select from corehq.apps.userreports.models import get_datasour...
none
1
1.849103
2
naive.py
LarsAstrom/Hashcode-final-2019
0
6632460
import argparse import random from collections import defaultdict from score import parse # inp is an input file as a single string # return your output as a string def solve(seed, inp, log): # TODO: Solve the problem random.seed(seed) ns = parse(inp) uncomps = [i for i in range(ns.C)] #cur_comp = ...
import argparse import random from collections import defaultdict from score import parse # inp is an input file as a single string # return your output as a string def solve(seed, inp, log): # TODO: Solve the problem random.seed(seed) ns = parse(inp) uncomps = [i for i in range(ns.C)] #cur_comp = ...
en
0.830088
# inp is an input file as a single string # return your output as a string # TODO: Solve the problem #cur_comp = 0
2.825264
3
All_Source_Code/CleanseData/CleanseData_3.py
APMonitor/pds
11
6632461
<filename>All_Source_Code/CleanseData/CleanseData_3.py result = z.dropna()
<filename>All_Source_Code/CleanseData/CleanseData_3.py result = z.dropna()
none
1
1.140392
1
agent_simple_cartpole.py
halcyoona/reinforcement-learning-demo
0
6632462
import gym import random class Agent(): def __init__(self, env): self.action_size = env.action_space.n print("Action Size: ", self.action_size) def get_action(self, state): # action = random.choice(range(self.action_size)) pole_angles = state[2] action = 0 if ...
import gym import random class Agent(): def __init__(self, env): self.action_size = env.action_space.n print("Action Size: ", self.action_size) def get_action(self, state): # action = random.choice(range(self.action_size)) pole_angles = state[2] action = 0 if ...
en
0.36326
# action = random.choice(range(self.action_size)) # action = env.action_space.sample()
3.208847
3
NFC_Reader/quick2wire/gpio.py
lleon95/NFC_Points_Service
46
6632463
"""A convenient API to access the GPIO pins of the Raspberry Pi. """ import os import subprocess from contextlib import contextmanager from quick2wire.board_revision import revision from quick2wire.selector import EDGE def gpio_admin(subcommand, pin, pull=None): if pull: subprocess.check_call(["gpio-adm...
"""A convenient API to access the GPIO pins of the Raspberry Pi. """ import os import subprocess from contextlib import contextmanager from quick2wire.board_revision import revision from quick2wire.selector import EDGE def gpio_admin(subcommand, pin, pull=None): if pull: subprocess.check_call(["gpio-adm...
en
0.789349
A convenient API to access the GPIO pins of the Raspberry Pi. The value of the pin: 1 if the pin is high, 0 if the pin is low. Controls a GPIO pin. Creates a pin Parameters: user_pin_number -- the identity of the pin used to create the derived class. soc_pin_number -- the pin on the he...
3.588705
4
anuga/file_conversion/sww2array.py
GeoscienceAustralia/anuga_core
136
6632464
<gh_stars>100-1000 """ Module to convert SWW to DEM files. """ from __future__ import print_function from __future__ import absolute_import from __future__ import division # external modules from builtins import str from builtins import range from past.utils import old_div from future.utils import raise_ import os...
""" Module to convert SWW to DEM files. """ from __future__ import print_function from __future__ import absolute_import from __future__ import division # external modules from builtins import str from builtins import range from past.utils import old_div from future.utils import raise_ import os import numpy as nu...
en
0.743315
Module to convert SWW to DEM files. # external modules # ANUGA modules ###### # formula mappings ###### # Default block size for sww2dem() # defaults to elevation Read SWW file and convert to a numpy array (can be stored to a png file later) The parameter quantity must be the name of an existing quantity or a...
2.390723
2
analysis/aero/avl_mat_to_json.py
leozz37/makani
1,178
6632465
#!/usr/bin/python # Copyright 2020 Makani Technologies 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 applicabl...
#!/usr/bin/python # Copyright 2020 Makani Technologies 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 applicabl...
en
0.820102
#!/usr/bin/python # Copyright 2020 Makani Technologies 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 applicabl...
2.556003
3
server/web_constants.py
lrgr/imuse-server
0
6632466
import os import re from enum import Enum OBJ_DIR = '/obj' META_DATA_FILENAME = 'meta-data.tsv' META_SIGS_FILENAME = 'meta-sigs.tsv' META_PATHWAYS_FILENAME = 'meta-pathways.tsv' META_FEATURED_FILENAME = 'meta-featured.tsv' META_CLINICAL_FILENAME = 'meta-clinical.tsv' META_TRICOUNTS_FILENAME = 'meta-tricounts.tsv' ON...
import os import re from enum import Enum OBJ_DIR = '/obj' META_DATA_FILENAME = 'meta-data.tsv' META_SIGS_FILENAME = 'meta-sigs.tsv' META_PATHWAYS_FILENAME = 'meta-pathways.tsv' META_FEATURED_FILENAME = 'meta-featured.tsv' META_CLINICAL_FILENAME = 'meta-clinical.tsv' META_TRICOUNTS_FILENAME = 'meta-tricounts.tsv' ON...
en
0.396747
# Regular Expressions # Column names for extended mutation tables # Special clinical variables # Column names for gene expression tables # Signatures columns # Mutation data columns # Pathways data columns # Clinical variables columns # Tri-counts data columns
1.916264
2
niftypad/image_process/regions.py
JJiao/NiftyPAD
0
6632467
__author__ = '<NAME>' __email__ = "<EMAIL>" import numpy as np import nibabel as nib def extract_regional_values(image, parcellation, labels): idx = labels_to_index(parcellation, labels) regional_values = np.mean(image[idx, ], axis=0) return regional_values def labels_to_index(parcellation, labels): ...
__author__ = '<NAME>' __email__ = "<EMAIL>" import numpy as np import nibabel as nib def extract_regional_values(image, parcellation, labels): idx = labels_to_index(parcellation, labels) regional_values = np.mean(image[idx, ], axis=0) return regional_values def labels_to_index(parcellation, labels): ...
none
1
2.540958
3
scorecard/profile_data/indicators/series.py
Code4SA/municipal-data-api
0
6632468
<filename>scorecard/profile_data/indicators/series.py class SeriesIndicator(): @classmethod def get_muni_specifics(cls, api_data): results = api_data.results years = api_data.years return { "result_type": cls.result_type, "values": cls.get_values(years, results...
<filename>scorecard/profile_data/indicators/series.py class SeriesIndicator(): @classmethod def get_muni_specifics(cls, api_data): results = api_data.results years = api_data.years return { "result_type": cls.result_type, "values": cls.get_values(years, results...
none
1
2.563543
3
testGroup.py
Zoushangjie/python-code
0
6632469
import numpy as np if 0: number = [1, 2, 3] print(number) number.append(9) print(number) number.append("hhh") print(number) number.extend([5, 3, 6, 8]) print(number) number.insert(0, "StartsHere") print(number) number.remove(3) print(number) number.remove(3) pr...
import numpy as np if 0: number = [1, 2, 3] print(number) number.append(9) print(number) number.append("hhh") print(number) number.extend([5, 3, 6, 8]) print(number) number.insert(0, "StartsHere") print(number) number.remove(3) print(number) number.remove(3) pr...
en
0.825459
#The next block is the demon of list slicing #"start and print from here and stop before the next No." # Ah, actually, this method is "start and print from here until the last" # Now I am going to add the third parameter: step distnce--bu chang in Chinese # start at [1] and stop before [5], two "steps" as a step. If th...
4.25113
4
pychess/Variants/atomic.py
jacobchrismarsh/chess_senior_project
0
6632470
# Atomic Chess from pychess.Utils.const import ( VARIANTS_OTHER_NONSTANDARD, KING, ATOMICCHESS, ENPASSANT, B8, E1, ) from pychess.Utils.Board import Board from pychess.Utils.Cord import Cord from pychess.Utils.Move import Move from pychess.Utils.lutils.bitboard import iterBits from pychess.Util...
# Atomic Chess from pychess.Utils.const import ( VARIANTS_OTHER_NONSTANDARD, KING, ATOMICCHESS, ENPASSANT, B8, E1, ) from pychess.Utils.Board import Board from pychess.Utils.Cord import Cord from pychess.Utils.Move import Move from pychess.Utils.lutils.bitboard import iterBits from pychess.Util...
en
0.763947
# Atomic Chess # fcord = (move >> 6) & 63
2.561276
3
cumulusci/core/tests/test_flows.py
1handclapping/CumulusCI
0
6632471
<reponame>1handclapping/CumulusCI<gh_stars>0 """ Tests for the Flow engine """ import unittest import logging import mock from collections import Callable from cumulusci.core.flows import BaseFlow from cumulusci.core.tasks import BaseTask from cumulusci.core.config import FlowConfig from cumulusci.core.config import...
""" Tests for the Flow engine """ import unittest import logging import mock from collections import Callable from cumulusci.core.flows import BaseFlow from cumulusci.core.tasks import BaseTask from cumulusci.core.config import FlowConfig from cumulusci.core.config import OrgConfig from cumulusci.core.exceptions imp...
en
0.910759
Tests for the Flow engine Tests the expectations of a BaseFlow caller BaseFlow initializes and offers a logger BaseFlow exposes itself as a callable for use A flow's options reach into return values from other tasks. # instantiate a flow with two tasks # run the flow # the flow results for the second task should be 'na...
2.253898
2
baekjoon/python/guitarlist_1495.py
yskang/AlgorithmPractice
0
6632472
# Title: 기타리스트 # Link: https://www.acmicpc.net/problem/1495 import sys sys.setrecursionlimit(10 ** 6) read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' '))) def solution(n: int, s: int, m: int, v: list): dp = [{} for _ in range(n+1)] dp[0][s] = True for i in range(0, n): ...
# Title: 기타리스트 # Link: https://www.acmicpc.net/problem/1495 import sys sys.setrecursionlimit(10 ** 6) read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' '))) def solution(n: int, s: int, m: int, v: list): dp = [{} for _ in range(n+1)] dp[0][s] = True for i in range(0, n): ...
en
0.49608
# Title: 기타리스트 # Link: https://www.acmicpc.net/problem/1495
2.765428
3
opts.py
xuehuiping/Global-Encoding
0
6632473
<filename>opts.py def model_opts(parser): parser.add_argument('-config', default='lcsts.yaml', type=str, help="config file") parser.add_argument('-gpus', default=[], nargs='+', type=int, help="Use CUDA on the listed devices.") parser.add_argument('-restore', ...
<filename>opts.py def model_opts(parser): parser.add_argument('-config', default='lcsts.yaml', type=str, help="config file") parser.add_argument('-gpus', default=[], nargs='+', type=int, help="Use CUDA on the listed devices.") parser.add_argument('-restore', ...
none
1
2.120573
2
task/sseg/module/backbone/__init__.py
ZHKKKe/PixelSSL
223
6632474
""" This file is adapted from https://github.com/jfzhang95/pytorch-deeplab-xception """ from . import resnet def build_backbone(backbone, output_stride, BatchNorm, pretrained_backbone_url): if backbone in ['resnet50']: return resnet.ResNet50(output_stride, BatchNorm, pretrained_backbone_url) elif bac...
""" This file is adapted from https://github.com/jfzhang95/pytorch-deeplab-xception """ from . import resnet def build_backbone(backbone, output_stride, BatchNorm, pretrained_backbone_url): if backbone in ['resnet50']: return resnet.ResNet50(output_stride, BatchNorm, pretrained_backbone_url) elif bac...
en
0.875327
This file is adapted from https://github.com/jfzhang95/pytorch-deeplab-xception
2.330137
2
webapi/db/dals/comment_dal.py
xqhgit/fastapi-vue-blog
3
6632475
# -*-coding:utf-8 -*- from typing import List, Optional from sqlalchemy import func, desc, delete, update from sqlalchemy.future import select from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import selectinload, joinedload from webapi.db.models import Comment from webapi.db.schemas.comment import ...
# -*-coding:utf-8 -*- from typing import List, Optional from sqlalchemy import func, desc, delete, update from sqlalchemy.future import select from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import selectinload, joinedload from webapi.db.models import Comment from webapi.db.schemas.comment import ...
en
0.652073
# -*-coding:utf-8 -*-
2.303869
2
handlers/__init__.py
Args-Engine/rb-distributed-helloworld
0
6632476
from .handshake_handler import HandshakeHandler from .pingpong_handler import PingPongHandler handler_types = {"Handshake": HandshakeHandler.handle, "Ping": PingPongHandler.handle}
from .handshake_handler import HandshakeHandler from .pingpong_handler import PingPongHandler handler_types = {"Handshake": HandshakeHandler.handle, "Ping": PingPongHandler.handle}
none
1
1.559551
2
src/sage/combinat/integer_lists/__init__.py
defeo/sage
3
6632477
<gh_stars>1-10 from __future__ import absolute_import from .base import IntegerListsBackend, Envelope from .lists import IntegerLists from .invlex import IntegerListsLex from sage.structure.sage_object import register_unpickle_override register_unpickle_override('sage.combinat.integer_list', 'IntegerListsLex', Intege...
from __future__ import absolute_import from .base import IntegerListsBackend, Envelope from .lists import IntegerLists from .invlex import IntegerListsLex from sage.structure.sage_object import register_unpickle_override register_unpickle_override('sage.combinat.integer_list', 'IntegerListsLex', IntegerListsLex)
none
1
1.178677
1
src/core/models.py
IssTech/IssAssist
0
6632478
<filename>src/core/models.py # Django Core Modules from django.db import models from django.conf import settings # Apps specific class CoreConfig(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1, on_delete=models.CASCADE) hostname = models.CharField(max_length = 128, default = 'hostname...
<filename>src/core/models.py # Django Core Modules from django.db import models from django.conf import settings # Apps specific class CoreConfig(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1, on_delete=models.CASCADE) hostname = models.CharField(max_length = 128, default = 'hostname...
en
0.227467
# Django Core Modules # Apps specific #isssys_agent = models.ForeignKey(IssSys, default=None, blank=True, null=True, on_delete=models.CASCADE)
2.117107
2
tests/benchmarks/bm_symeig3x3.py
janEbert/pytorch3d
1
6632479
<gh_stars>1-10 # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from itertools import product from typing import Any, Callable import torch from common_testin...
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from itertools import product from typing import Any, Callable import torch from common_testing import get_ra...
en
0.916975
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. # Run CUDA-only implementations only on GPU # Torch built-ins are quite slow on larger batches # Avoid running C...
1.758614
2
Z - Tool Box/x2john/dmg2john.py
dfirpaul/Active-Directory-Exploitation-Cheat-Sheet-1
2,109
6632480
<filename>Z - Tool Box/x2john/dmg2john.py #!/usr/bin/env python # Written by <NAME> <dhiru at openwall.com> in March, 2013 # My code is under "Simplified BSD License" import sys import os import struct from binascii import hexlify # header structs are taken from vilefault and hashkill projects v1_header_fmt = '> 48s...
<filename>Z - Tool Box/x2john/dmg2john.py #!/usr/bin/env python # Written by <NAME> <dhiru at openwall.com> in March, 2013 # My code is under "Simplified BSD License" import sys import os import struct from binascii import hexlify # header structs are taken from vilefault and hashkill projects v1_header_fmt = '> 48s...
en
0.863184
#!/usr/bin/env python # Written by <NAME> <dhiru at openwall.com> in March, 2013 # My code is under "Simplified BSD License" # header structs are taken from vilefault and hashkill projects # v2_header_fmt = '> 8s I I I I I I I 16s I Q Q 24s I I I I 32s I 32s I I I I I 48s' # encrypted_blob_size can be 64, handle such c...
2.138239
2
scrapy_middlewares/req_middleware.py
CLannadZSY/scrapy-middlewares
0
6632481
import logging logger = logging.getLogger('ModuleReqMiddleware.request') class ReqMiddleware: def __init__(self, settings, *args, **kwargs): super(ReqMiddleware, self).__init__(*args, **kwargs) self._settings = settings self.logger = logger @staticmethod def transform_headers(hea...
import logging logger = logging.getLogger('ModuleReqMiddleware.request') class ReqMiddleware: def __init__(self, settings, *args, **kwargs): super(ReqMiddleware, self).__init__(*args, **kwargs) self._settings = settings self.logger = logger @staticmethod def transform_headers(hea...
none
1
2.417673
2
app.py
daleattier/timer
0
6632482
<reponame>daleattier/timer<filename>app.py # -*- coding: utf-8 -*- """ author: <NAME> blog: withlihui.com email: <EMAIL> github: github.com/greyli column: zhuanlan.zhihu.com/flask --------------------------------- A simple timer made with Flask and JavaScript. https://github.com/helloflask/timer -----------------------...
# -*- coding: utf-8 -*- """ author: <NAME> blog: withlihui.com email: <EMAIL> github: github.com/greyli column: zhuanlan.zhihu.com/flask --------------------------------- A simple timer made with Flask and JavaScript. https://github.com/helloflask/timer --------------------------------- MIT license. """ import re from ...
en
0.485094
# -*- coding: utf-8 -*- author: <NAME> blog: withlihui.com email: <EMAIL> github: github.com/greyli column: zhuanlan.zhihu.com/flask --------------------------------- A simple timer made with Flask and JavaScript. https://github.com/helloflask/timer --------------------------------- MIT license. # use re to validate in...
3.15666
3
scripts/plot_stats_sensors.py
kingjr/decod_unseen_maintenance
10
6632483
# Author: <NAME> <<EMAIL>> # # Licence: BSD 3-clause """Plot the topographical effects obtained in each analysis. Used to generate Figure 3. """ import numpy as np import matplotlib.pyplot as plt from jr.plot import plot_butterfly, plot_gfp, pretty_colorbar from config import report, load from conditions import analy...
# Author: <NAME> <<EMAIL>> # # Licence: BSD 3-clause """Plot the topographical effects obtained in each analysis. Used to generate Figure 3. """ import numpy as np import matplotlib.pyplot as plt from jr.plot import plot_butterfly, plot_gfp, pretty_colorbar from config import report, load from conditions import analy...
en
0.631646
# Author: <NAME> <<EMAIL>> # # Licence: BSD 3-clause Plot the topographical effects obtained in each analysis. Used to generate Figure 3. # Apply contrast on each type of epoch # load stats # to avoid interpolation bug # used for tois # Find significant cluster # Define color limit # clim text # Plot topo snapshots # ...
2.370272
2
modules/sticky_note/lv1_stickynote.py
naaya17/carpe
56
6632484
<reponame>naaya17/carpe # -*- coding:utf-8 -*- import sqlite3 import datetime import os import pandas as pd import olefile import re """ testcase 1.[win7]_가상환경_StickyNotes.snt """ class Sticky_Note_Information: par_id = '' case_id = '' evd_id = '' note_id = '' type = '' content = '' activa...
# -*- coding:utf-8 -*- import sqlite3 import datetime import os import pandas as pd import olefile import re """ testcase 1.[win7]_가상환경_StickyNotes.snt """ class Sticky_Note_Information: par_id = '' case_id = '' evd_id = '' note_id = '' type = '' content = '' activated = '' createdtime...
ko
0.155269
# -*- coding:utf-8 -*- testcase 1.[win7]_가상환경_StickyNotes.snt # id의 정규표현식 : \id=[a-zA-Z0-9_]{8}-[a-zA-Z0-9_]{4}-[a-zA-Z0-9_]{4}-[a-zA-Z0-9_]{4}-[a-zA-Z0-9_]{12} # elif column_name in media_id_list: # temp_result_dictionary["Media_Id"] = Parse2Id(data) # 결과 값에서 Text와 image를 엮기 위해서 ParentId를 Id로 바꿔줌 basepath = os.get...
2.547248
3
com/client.py
clllllllllc/unicorn-pancake
0
6632485
import threading import socket host = '10.173.16.225' port = 55554 nickname = input("Please Enter Nickname: ") client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect((host, port)) def receive(): while True: try: message = client.recv(1024).decode('ascii') if m...
import threading import socket host = '10.173.16.225' port = 55554 nickname = input("Please Enter Nickname: ") client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect((host, port)) def receive(): while True: try: message = client.recv(1024).decode('ascii') if m...
none
1
3.004477
3
conf/migrations/0001_initial.py
abingprogrammer/OnlineJudge-master
0
6632486
<reponame>abingprogrammer/OnlineJudge-master # Generated by Django 2.0.1 on 2018-04-26 15:47 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='JudgeServer', ...
# Generated by Django 2.0.1 on 2018-04-26 15:47 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='JudgeServer', fields=[ ('id', models.AutoFi...
en
0.791378
# Generated by Django 2.0.1 on 2018-04-26 15:47
1.87201
2
Project1.py
varnaugj/Python-Early-Codes
0
6632487
from tkinter import * import tkinter as tk window = tk.Tk() greeting = tk.Label(text="Test 123") greeting.pack() def returnEntry(arg=None): name = myEntry.get() resultLabel.config(text= name) myEntry.delete(0,END) myEntry = tk.Entry(width=20) myEntry.focus() myEntry.bind("<Return>", returnEntry) myEnt...
from tkinter import * import tkinter as tk window = tk.Tk() greeting = tk.Label(text="Test 123") greeting.pack() def returnEntry(arg=None): name = myEntry.get() resultLabel.config(text= name) myEntry.delete(0,END) myEntry = tk.Entry(width=20) myEntry.focus() myEntry.bind("<Return>", returnEntry) myEnt...
en
0.277602
#val = input("Enter Text here: ") #print(val) #entry = tk.Entry(fg="black",bg="white", width=50) #entry.pack()
3.9277
4
opendirection/stats/tools.py
adamltyson/opendirection
0
6632488
<reponame>adamltyson/opendirection import logging import random import numpy as np import multiprocessing as mp from scipy.stats import percentileofscore from imlib.general.system import sanitize_num_processes import opendirection.spikes.tools as spike_tools import opendirection.tools.tools as tools MIN_PROCESSES = ...
import logging import random import numpy as np import multiprocessing as mp from scipy.stats import percentileofscore from imlib.general.system import sanitize_num_processes import opendirection.spikes.tools as spike_tools import opendirection.tools.tools as tools MIN_PROCESSES = 1 def apply_random_sign(number): ...
en
0.745765
# Define an output queue # add output to args # array of shuffle magnitudes to go through # split up the shuffle magnitudes into blocks for each process # Setup a list of processes # Run processes # Exit the completed processes # Get process results from the output queue # Get process results from the output queue :par...
2.469406
2
app/plugin/biu/do/unfollow.py
2chips/PixivBiu
1
6632489
<reponame>2chips/PixivBiu<gh_stars>1-10 # coding=utf-8 # pylint: disable=relative-beyond-top-level from ....platform import CMDProcessor @CMDProcessor.plugin_register("api/biu/do/unfollow") class doUnFollow(object): def __init__(self, MOD): self.MOD = MOD def pRun(self, cmd): if self.MOD.biu....
# coding=utf-8 # pylint: disable=relative-beyond-top-level from ....platform import CMDProcessor @CMDProcessor.plugin_register("api/biu/do/unfollow") class doUnFollow(object): def __init__(self, MOD): self.MOD = MOD def pRun(self, cmd): if self.MOD.biu.apiType != "public": return ...
en
0.663243
# coding=utf-8 # pylint: disable=relative-beyond-top-level
2.149899
2
P2P_simulation.py
tabsa/P2P_market_MAD
0
6632490
<filename>P2P_simulation.py ## RL agent for the Energy P2P market as Multi-Armed Bandit (MAD) problem # Application of MAD problem to the energy P2P market # TBA #%% Import packages import numpy as np import pandas as pd import pickle as pkl import os # Import Class and functions from MAD_env import trading_env, tradi...
<filename>P2P_simulation.py ## RL agent for the Energy P2P market as Multi-Armed Bandit (MAD) problem # Application of MAD problem to the energy P2P market # TBA #%% Import packages import numpy as np import pandas as pd import pickle as pkl import os # Import Class and functions from MAD_env import trading_env, tradi...
en
0.767428
## RL agent for the Energy P2P market as Multi-Armed Bandit (MAD) problem # Application of MAD problem to the energy P2P market # TBA #%% Import packages # Import Class and functions #%% Hyperparameters for the validation ## Path of the file with the training loop # Get from the 'results/' folder # Replace by other if ...
2.592681
3
examples/lsp_manual_metric_perf_model_prototype.py
tim-fiola/network_traffic_modeler_py3
102
6632491
<reponame>tim-fiola/network_traffic_modeler_py3 import sys sys.path.append("../") from pprint import pprint from pyNTM import PerformanceModel from pyNTM import RSVP_LSP model = PerformanceModel.load_model_file("perf_model_lsp_metric.csv") model.update_simulation() lsp_a_d_1 = model.get_rsvp_lsp("A", "D", "lsp_a_d_...
import sys sys.path.append("../") from pprint import pprint from pyNTM import PerformanceModel from pyNTM import RSVP_LSP model = PerformanceModel.load_model_file("perf_model_lsp_metric.csv") model.update_simulation() lsp_a_d_1 = model.get_rsvp_lsp("A", "D", "lsp_a_d_1") lsp_a_d_2 = model.get_rsvp_lsp("A", "D", "ls...
none
1
2.210426
2
pytype/tools/xref/testdata/classdef_in_function.py
Jrryy/pytype
3,882
6632492
<reponame>Jrryy/pytype # pylint: skip-file def f(): #- @A defines/binding ClassA #- ClassA.node/kind class class A: pass def g(): #- @B defines/binding ClassB #- ClassB.node/kind class class B: pass return B def h(base): #- @C defines/binding ClassC #- ClassC.node/kind class class C(ba...
# pylint: skip-file def f(): #- @A defines/binding ClassA #- ClassA.node/kind class class A: pass def g(): #- @B defines/binding ClassB #- ClassB.node/kind class class B: pass return B def h(base): #- @C defines/binding ClassC #- ClassC.node/kind class class C(base): pass #- @D ...
en
0.145511
# pylint: skip-file #- @A defines/binding ClassA #- ClassA.node/kind class #- @B defines/binding ClassB #- ClassB.node/kind class #- @C defines/binding ClassC #- ClassC.node/kind class #- @D defines/binding ClassD #- ClassD.node/kind class
2.295242
2
osp/test/citations/jstor_record/test_pagination.py
davidmcclure/open-syllabus-project
220
6632493
import pytest from osp.citations.jstor_record import JSTOR_Record @pytest.mark.parametrize('fpage,lpage,pagination', [ # Both. (100, 200, '100-200'), # Just fpage. (100, '', '100'), # Just lpage. ('', 200, '200'), # Neither. ('', '', None), ]) def test_pagination(fpage, lpage, ...
import pytest from osp.citations.jstor_record import JSTOR_Record @pytest.mark.parametrize('fpage,lpage,pagination', [ # Both. (100, 200, '100-200'), # Just fpage. (100, '', '100'), # Just lpage. ('', 200, '200'), # Neither. ('', '', None), ]) def test_pagination(fpage, lpage, ...
en
0.690724
# Both. # Just fpage. # Just lpage. # Neither.
2.320287
2
bio-info/bioinfo_7.py
kyamada101/Python
0
6632494
<reponame>kyamada101/Python import numpy as np import math from scipy.special import logsumexp log05 = np.log(0.5) x_str = "3151162464466442453113216311641521336251445436316566265666666511664531326512456366646316366631623264552362666666251516312225554416665665635643243641315134651463534111264146262533563661636664662...
import numpy as np import math from scipy.special import logsumexp log05 = np.log(0.5) x_str = "31511624644664424531132163116415213362514454363165662656666665116645313265124563666463163666316232645523626666662515163122255544166656656356432436413151346514635341112641462625335636616366646623253441366166116325256246225...
ja
0.993823
#lが状態番号、bがx #kとlは状態番号 #lは状態番号、bはx #kとlは状態番号
3.044878
3
models/train_classifier.py
explorer70/DisasterRecoveryNLP
0
6632495
import sys import pandas as pd import pickle from sqlalchemy import create_engine from sklearn.pipeline import Pipeline, FeatureUnion from sklearn.metrics import confusion_matrix from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier from sklearn.model_selection import train_test_split from sklea...
import sys import pandas as pd import pickle from sqlalchemy import create_engine from sklearn.pipeline import Pipeline, FeatureUnion from sklearn.metrics import confusion_matrix from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier from sklearn.model_selection import train_test_split from sklea...
en
0.640667
The functions loads data from sqlite database providd the path It returns the features X, labels Y and the label names. # drop data with no categories assigned The function will remove punctuation, normalize the text case, lemmatize and remove the stop words # normalize case and remove punctuation # tokenize text #...
2.871366
3
standard_lib/async_sleep_sync.py
DahlitzFlorian/python-snippets
29
6632496
<reponame>DahlitzFlorian/python-snippets """ Async snippet demonstrating the usage of time.sleep() """ import asyncio import time from datetime import datetime async def custom_sleep(): print("SLEEP", datetime.now()) time.sleep(1) async def factorial(name, number): f = 1 for i in range(2, number + 1...
""" Async snippet demonstrating the usage of time.sleep() """ import asyncio import time from datetime import datetime async def custom_sleep(): print("SLEEP", datetime.now()) time.sleep(1) async def factorial(name, number): f = 1 for i in range(2, number + 1): print(f"Task {name}: Compute f...
en
0.736647
Async snippet demonstrating the usage of time.sleep()
4.000955
4
bardolph/controller/lsc_template.py
al-fontes-jr/bardolph
0
6632497
#!/usr/bin/env python import argparse import logging from bardolph.lib import injection from bardolph.lib import settings from bardolph.controller import arg_helper from bardolph.controller import config_values from bardolph.controller import light_module from bardolph.controller.units import UnitMode from bardolph.v...
#!/usr/bin/env python import argparse import logging from bardolph.lib import injection from bardolph.lib import settings from bardolph.controller import arg_helper from bardolph.controller import config_values from bardolph.controller import light_module from bardolph.controller.units import UnitMode from bardolph.v...
ru
0.172319
#!/usr/bin/env python #instructions
2.035261
2
qiskit/aqua/components/feature_maps/pauli_expansion.py
aaita92/qiskit-aqua
2
6632498
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
en
0.751068
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any ...
2.26276
2
src/transformers/utils/__init__.py
aakashb95/transformers
0
6632499
#!/usr/bin/env python # coding=utf-8 # flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version...
#!/usr/bin/env python # coding=utf-8 # flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version...
en
0.848802
#!/usr/bin/env python # coding=utf-8 # flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2...
1.291974
1
app/modules/api/user/user.py
FannyFirst/BunShop-flask
0
6632500
<reponame>FannyFirst/BunShop-flask from flask_restplus import Namespace, Resource from flask import request from app.modules.dao.user.user import User from app.extensions.response import * api = Namespace("User", "user api", "/user") DAO = User() @api.route("/") class UserList(Resource): def get(self): ...
from flask_restplus import Namespace, Resource from flask import request from app.modules.dao.user.user import User from app.extensions.response import * api = Namespace("User", "user api", "/user") DAO = User() @api.route("/") class UserList(Resource): def get(self): return response(DAO.list()) # @a...
en
0.323865
# @api.route("/<int:_id>") # class User(Resource): # # def get(self, _id): # return response(DAO.get(_id)) # # # @api.param("name", "user name") # # def put(self, _id): # # name = request.args.get("name") # # if name is None: # # return response(code=BaseResponse.PARAM_NO...
2.715583
3
setup.py
kokron/anzu
6
6632501
<filename>setup.py from setuptools import setup, find_packages setup( name='anzu', version='1.0', packages=find_packages(), package_dir={'anzu' : 'anzu'}, package_data={'anzu': ['data/*']}, long_description=open('README.md').read(), )
<filename>setup.py from setuptools import setup, find_packages setup( name='anzu', version='1.0', packages=find_packages(), package_dir={'anzu' : 'anzu'}, package_data={'anzu': ['data/*']}, long_description=open('README.md').read(), )
none
1
1.391882
1
csv files/scatter.py
hriday-wpo8a/c103
0
6632502
<filename>csv files/scatter.py import pandas as pd import plotly.express as px df=pd.read_csv("data.csv") fig = px.scatter(df,x="Population",y="Per capita",size="Percentage",color="Country",size_max = 60) fig.show()
<filename>csv files/scatter.py import pandas as pd import plotly.express as px df=pd.read_csv("data.csv") fig = px.scatter(df,x="Population",y="Per capita",size="Percentage",color="Country",size_max = 60) fig.show()
none
1
3.712196
4
tests/sat/Intensive/c890.200.UNSAT.dimacs.test.py
bernardocuteri/wasp
19
6632503
<filename>tests/sat/Intensive/c890.200.UNSAT.dimacs.test.py input = """ c num blocks = 1 c num vars = 200 c minblockids[0] = 1 c maxblockids[0] = 200 p cnf 200 890 -80 -16 -14 0 -14 -200 -190 0 61 -149 133 0 -86 -126 -9 0 11 -79 -15 0 -119 -191 -174 0 -154 -29 -134 0 -78 -118 76 0 -106 119 173 0 131 -140 -141 0 64 18 -...
<filename>tests/sat/Intensive/c890.200.UNSAT.dimacs.test.py input = """ c num blocks = 1 c num vars = 200 c minblockids[0] = 1 c maxblockids[0] = 200 p cnf 200 890 -80 -16 -14 0 -14 -200 -190 0 61 -149 133 0 -86 -126 -9 0 11 -79 -15 0 -119 -191 -174 0 -154 -29 -134 0 -78 -118 76 0 -106 119 173 0 131 -140 -141 0 64 18 -...
fr
0.14599
c num blocks = 1 c num vars = 200 c minblockids[0] = 1 c maxblockids[0] = 200 p cnf 200 890 -80 -16 -14 0 -14 -200 -190 0 61 -149 133 0 -86 -126 -9 0 11 -79 -15 0 -119 -191 -174 0 -154 -29 -134 0 -78 -118 76 0 -106 119 173 0 131 -140 -141 0 64 18 -147 0 -132 -12 158 0 122 -143 -117 0 -5 80 -128 0 -113 -108 -171 0 62 -1...
1.960158
2
pipeline/util/__init__.py
kasei/pipeline
5
6632504
import re import os import sys import fnmatch import pprint import calendar import datetime from threading import Lock from contextlib import ContextDecorator, suppress from collections import defaultdict, namedtuple import warnings import dateutil.parser from bonobo.config import Configurable, Option, Service import...
import re import os import sys import fnmatch import pprint import calendar import datetime from threading import Lock from contextlib import ContextDecorator, suppress from collections import defaultdict, namedtuple import warnings import dateutil.parser from bonobo.config import Configurable, Option, Service import...
en
0.811378
# Dimension = namedtuple("Dimension", [ # 'value', # numeric value # 'unit', # unit # 'which' # e.g. width, height, ... # ]) # Simply yield the value that is passed as an argument. This is trivial, but necessary for use in constructing some bonobo graphs. For example, if two already instantiated graph chains ne...
2.673648
3
code/model_training.py
lucaskup/PorosityAnalisys
0
6632505
<gh_stars>0 import seaborn as sns from pathlib import Path import pandas as pd import numpy as np import copy from scipy.stats import t from sklearn.model_selection import RepeatedKFold from sklearn.preprocessing import MinMaxScaler from sklearn.ensemble import RandomForestRegressor from sklearn.neighbors import KNeigh...
import seaborn as sns from pathlib import Path import pandas as pd import numpy as np import copy from scipy.stats import t from sklearn.model_selection import RepeatedKFold from sklearn.preprocessing import MinMaxScaler from sklearn.ensemble import RandomForestRegressor from sklearn.neighbors import KNeighborsRegresso...
en
0.613491
# Import the data # Auxiliary Functions Evaluates the model using LOOCV and creates a file with the results. Parameters: model (sklearn.model): Sklearn model model_name (int): Name of the algorithm save_results (bool): save results to a file ...
2.557662
3
cla_backend/apps/cla_eventlog/migrations/0001_initial.py
uk-gov-mirror/ministryofjustice.cla_backend
3
6632506
<gh_stars>1-10 # coding=utf-8 from __future__ import unicode_literals from django.conf import settings from django.db import models, migrations import django.utils.timezone import jsonfield.fields import model_utils.fields class Migration(migrations.Migration): dependencies = [ ("legalaid", "0001_initi...
# coding=utf-8 from __future__ import unicode_literals from django.conf import settings from django.db import models, migrations import django.utils.timezone import jsonfield.fields import model_utils.fields class Migration(migrations.Migration): dependencies = [ ("legalaid", "0001_initial"), (...
en
0.644078
# coding=utf-8
1.803782
2
bloscpack/cli.py
sachk/bloscpack
87
6632507
<filename>bloscpack/cli.py #!/usr/bin/env python # -*- coding: utf-8 -*- # vim :set ft=py: import argparse from os import path import json import pprint import blosc from .args import (BloscArgs, BloscpackArgs, MetadataArgs, ) from .append import (append, ...
<filename>bloscpack/cli.py #!/usr/bin/env python # -*- coding: utf-8 -*- # vim :set ft=py: import argparse from os import path import json import pprint import blosc from .args import (BloscArgs, BloscpackArgs, MetadataArgs, ) from .append import (append, ...
en
0.548514
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim :set ft=py: Check files exist/don't exist. Parameters ---------- in_file : str: the input file out_file : str the output file args : parser args any additional arguments from the parser Raises ------ FileNotFou...
2.428568
2
vistrails/db/versions/v1_0_5/translate/v1_0_4.py
remram44/VisTrails-mybinder
0
6632508
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: <EMAIL> ## ## This file is part of VisTrails. ## ## "Redistributio...
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: <EMAIL> ## ## This file is part of VisTrails. ## ## "Redistributio...
en
0.596797
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: <EMAIL> ## ## This file is part of VisTrails. ## ## "Redistributio...
0.96853
1
solutions/Elementary/Fizz Buzz/1.py
Amaimersion/CheckiO-solutions
0
6632509
#Your optional code here #You can import some modules or create additional functions def checkio(number): string = "" if (number % 3 == 0) and (number % 5 == 0): string = "Fizz Buzz" elif (number % 3 == 0): string = "Fizz" elif (number % 5 == 0): string = "Buzz" ...
#Your optional code here #You can import some modules or create additional functions def checkio(number): string = "" if (number % 3 == 0) and (number % 5 == 0): string = "Fizz Buzz" elif (number % 3 == 0): string = "Fizz" elif (number % 5 == 0): string = "Buzz" ...
en
0.593756
#Your optional code here #You can import some modules or create additional functions #Some hints: #Convert a number in the string with str(n) #These "asserts" using only for self-checking and not necessary for auto-testing
4.052959
4
sample/openFileExample.py
luoluyao/AppetizerRemoteCall
0
6632510
import pycurl import io import json jsonStr = '{"port":8099, "fileName":"plugin.xml", "line":5, "col":5, "offsetline":4}' jsonStr1 = '{"port":8091, "fileName":"plugin.xml", "line":2, "col":0, "offsetline":4}' jsonStr2 = '{"port":8091, "fileName":"plugin.xml", "line":2, "col":5, "offsetline":0}' jsonStr3 = '{"port":809...
import pycurl import io import json jsonStr = '{"port":8099, "fileName":"plugin.xml", "line":5, "col":5, "offsetline":4}' jsonStr1 = '{"port":8091, "fileName":"plugin.xml", "line":2, "col":0, "offsetline":4}' jsonStr2 = '{"port":8091, "fileName":"plugin.xml", "line":2, "col":5, "offsetline":0}' jsonStr3 = '{"port":809...
es
0.169751
# todo: process return values
2.530338
3
test/conftest.py
Quisher/Grid
0
6632511
<reponame>Quisher/Grid import pytest import torch from multiprocessing import Process from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy import os import sys # We need to add our rest api as a path since it is a separate application # deployed on Heroku: sys.path.insert(0, os.path.dirname(os.pat...
import pytest import torch from multiprocessing import Process from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy import os import sys # We need to add our rest api as a path since it is a separate application # deployed on Heroku: sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + ...
en
0.790201
# We need to add our rest api as a path since it is a separate application # deployed on Heroku: # pragma: no cover helper function for spinning up a websocket participant # Init Grid Gateway # Init Grid Nodes
2.086605
2
go/go/forms.py
srct/go
7
6632512
<gh_stars>1-10 """ go/forms.py """ # Python stdlib Imports from datetime import datetime, timedelta # Django Imports from django.core.exceptions import ValidationError from django.forms import (BooleanField, CharField, ChoiceField, DateTimeField, ModelForm, RadioSelect, SlugField, Textarea, ...
""" go/forms.py """ # Python stdlib Imports from datetime import datetime, timedelta # Django Imports from django.core.exceptions import ValidationError from django.forms import (BooleanField, CharField, ChoiceField, DateTimeField, ModelForm, RadioSelect, SlugField, Textarea, ...
en
0.742338
go/forms.py # Python stdlib Imports # Django Imports # App Imports Prevent redirect loop links # get the entered target link # Custom target URL field # short -------------------------------------------------------------------- Check to make sure the short url has not been used # if we're able to get a URL with the sam...
2.476459
2
crossbeam/dsl/arithmetic_operations.py
ellisk42/xlambda
12
6632513
<filename>crossbeam/dsl/arithmetic_operations.py # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
<filename>crossbeam/dsl/arithmetic_operations.py # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
en
0.827575
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2.670984
3
examples/fonteffects/sample36_comet.py
chromia/wandplus
0
6632514
#!/usr/bin/env python from wand.image import Image from wand.drawing import Drawing from wand.color import Color from wandplus.image import motionblur # http://www.imagemagick.org/Usage/fonts/ # original imagemagick command: # convert -size 340x120 xc:lightblue -font Candice -pointsize 72 \ # -fill navy ...
#!/usr/bin/env python from wand.image import Image from wand.drawing import Drawing from wand.color import Color from wandplus.image import motionblur # http://www.imagemagick.org/Usage/fonts/ # original imagemagick command: # convert -size 340x120 xc:lightblue -font Candice -pointsize 72 \ # -fill navy ...
en
0.101383
#!/usr/bin/env python # http://www.imagemagick.org/Usage/fonts/ # original imagemagick command: # convert -size 340x120 xc:lightblue -font Candice -pointsize 72 \ # -fill navy -annotate +45+95 'Anthony' -motion-blur 0x25+65 \ # -fill black -annotate +45+95 'Anthony' -motion-blur 0x1+65 \ # ...
2.652598
3
woldrnaseq/make_star_rsem_dag.py
detrout/woldlab-rna-seq
2
6632515
"""STAR & RSEM based RNA-Seq pipeline. """ from __future__ import absolute_import, print_function from argparse import ArgumentParser import datetime import getpass import itertools import logging import os from pathlib import Path from pkg_resources import resource_filename import stat from jinja2 import Environment,...
"""STAR & RSEM based RNA-Seq pipeline. """ from __future__ import absolute_import, print_function from argparse import ArgumentParser import datetime import getpass import itertools import logging import os from pathlib import Path from pkg_resources import resource_filename import stat from jinja2 import Environment,...
en
0.750548
STAR & RSEM based RNA-Seq pipeline. # analysis name will default to analysis dir
2.26522
2
query_result.py
Berdugo1994/Tweeter-Search-Engine
0
6632516
<reponame>Berdugo1994/Tweeter-Search-Engine class QueryResult: def __init__(self, tweet_id, similarity, full_text): self.tweet_id = tweet_id self.similarity = similarity self.full_text = full_text def __str__(self): ...
class QueryResult: def __init__(self, tweet_id, similarity, full_text): self.tweet_id = tweet_id self.similarity = similarity self.full_text = full_text def __str__(self): # return ", Tweet id: " + self.tweet_id + ",...
en
0.191254
# return ", Tweet id: " + self.tweet_id + ", Score: " + str(self.similarity)
2.844301
3
average.py
subho781/MCA-Python-Assignment
0
6632517
<reponame>subho781/MCA-Python-Assignment<filename>average.py s1 = float(input('enter marks : ')) s2 = float(input('enter marks : ')) aggregate = (s1+s2)/2 print('aggregate :',aggregate)
s1 = float(input('enter marks : ')) s2 = float(input('enter marks : ')) aggregate = (s1+s2)/2 print('aggregate :',aggregate)
none
1
3.765894
4
examples/example_detrend.py
nbara/python-meegk
80
6632518
""" Robust detrending examples ========================== Some toy examples to showcase usage for ``meegkit.detrend`` module. Robust referencing is adapted from [1]. References ---------- > [1] <NAME>., & <NAME>. (2018). Robust detrending, rereferencing, outlier detection, and inpainting for multichannel data. N...
""" Robust detrending examples ========================== Some toy examples to showcase usage for ``meegkit.detrend`` module. Robust referencing is adapted from [1]. References ---------- > [1] <NAME>., & <NAME>. (2018). Robust detrending, rereferencing, outlier detection, and inpainting for multichannel data. N...
en
0.397905
Robust detrending examples ========================== Some toy examples to showcase usage for ``meegkit.detrend`` module. Robust referencing is adapted from [1]. References ---------- > [1] <NAME>., & <NAME>. (2018). Robust detrending, rereferencing, outlier detection, and inpainting for multichannel data. Neuro...
2.426304
2
publications/2022TPAMI/experiment-controller/python/singularity/resourcetest.py
fmohr/llcv
3
6632519
import json import ConfigSpace from ConfigSpace.util import * from ConfigSpace.read_and_write import json as config_json import random from commons import * import numpy as np import matplotlib.pyplot as plt from sklearn.pipeline import Pipeline from sklearn.preprocessing import RobustScaler from sklearn.decomposition ...
import json import ConfigSpace from ConfigSpace.util import * from ConfigSpace.read_and_write import json as config_json import random from commons import * import numpy as np import matplotlib.pyplot as plt from sklearn.pipeline import Pipeline from sklearn.preprocessing import RobustScaler from sklearn.decomposition ...
es
0.25872
#X, y = get_dataset(1485)
2.179228
2
d10/part1.py
Jamie-Chang/advent2021
0
6632520
<filename>d10/part1.py from typing import Final, Iterable, Iterator CLOSER: Final[dict[str, str]] = { "{": "}", "(": ")", "<": ">", "[": "]", } SCORES: Final[dict[str, int]] = { ")": 3, "]": 57, "}": 1197, ">": 25137, } def read() -> Iterator[str]: with open("d10/input.txt") as...
<filename>d10/part1.py from typing import Final, Iterable, Iterator CLOSER: Final[dict[str, str]] = { "{": "}", "(": ")", "<": ">", "[": "]", } SCORES: Final[dict[str, int]] = { ")": 3, "]": 57, "}": 1197, ">": 25137, } def read() -> Iterator[str]: with open("d10/input.txt") as...
zh
0.262515
>>> check("()") >>> check("(]") ']' >>> check("(") >>> check("]") ']'
3.51315
4
homeassistant/components/tasmota/sensor.py
MrDelik/core
22,481
6632521
"""Support for Tasmota sensors.""" from __future__ import annotations from datetime import datetime from typing import Any from hatasmota import const as hc, sensor as tasmota_sensor, status_sensor from hatasmota.entity import TasmotaEntity as HATasmotaEntity from hatasmota.models import DiscoveryHashType from homea...
"""Support for Tasmota sensors.""" from __future__ import annotations from datetime import datetime from typing import Any from hatasmota import const as hc, sensor as tasmota_sensor, status_sensor from hatasmota.entity import TasmotaEntity as HATasmotaEntity from hatasmota.models import DiscoveryHashType from homea...
en
0.747474
Support for Tasmota sensors. # A Tasmota sensor type may be mapped to either a device class or an icon, not both Set up Tasmota sensor dynamically through discovery. Discover and add a Tasmota sensor. Representation of a Tasmota sensor. Initialize the Tasmota sensor. Subscribe to MQTT events. Handle state updates. Retu...
1.924917
2
jsoncreator.py
WillCusick/HashRace
0
6632522
import json import redis from datetime import datetime, timedelta max_tweets_per_load = 200 delimit = ":\\:" len_delimit = len(delimit) def prune(red, tweet): breaking_point = tweet.find(":\\:") time_added = datetime.strptime(tweet[breaking_point+len_delimit:], "%Y-%m-%d %H:%M:%S.%f") time_now = ...
import json import redis from datetime import datetime, timedelta max_tweets_per_load = 200 delimit = ":\\:" len_delimit = len(delimit) def prune(red, tweet): breaking_point = tweet.find(":\\:") time_added = datetime.strptime(tweet[breaking_point+len_delimit:], "%Y-%m-%d %H:%M:%S.%f") time_now = ...
none
1
2.709976
3
docs/src/data/openbemt_to_ccblade.py
ZhaoWenGuang/CCBlade.jl
23
6632523
import sys import numpy as np if __name__ == "__main__": from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('--plot', action='store_true') parser.add_argument('xtfile') parser.add_argument('ytfile') parser.add_argument('outfilepattern') args = parser.parse_ar...
import sys import numpy as np if __name__ == "__main__": from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('--plot', action='store_true') parser.add_argument('xtfile') parser.add_argument('ytfile') parser.add_argument('outfilepattern') args = parser.parse_ar...
en
0.861475
# Check that the Reynolds numbers for this index are all the same.
2.581266
3
pymatting/laplacian/knn_laplacian.py
chendeheng611/pymatting
0
6632524
<filename>pymatting/laplacian/knn_laplacian.py import numpy as np import scipy.sparse from pymatting.util.kdtree import knn from pymatting.util.util import normalize_rows def knn_laplacian( image, n_neighbors=[20, 10], distance_weights=[2.0, 0.1], ): """ This function calculates the KNN matting Laplacian ...
<filename>pymatting/laplacian/knn_laplacian.py import numpy as np import scipy.sparse from pymatting.util.kdtree import knn from pymatting.util.util import normalize_rows def knn_laplacian( image, n_neighbors=[20, 10], distance_weights=[2.0, 0.1], ): """ This function calculates the KNN matting Laplacian ...
en
0.801189
This function calculates the KNN matting Laplacian matrix as described in :cite:`chen2013knn`. Parameters ---------- image: numpy.ndarray Image with shape :math:`h\\times w \\times 3` n_neighbors: list of ints Number of neighbors to consider. If :code:`len(n_neighbors)>1` multiple neare...
3.535841
4
13/13a.py
dfwarden/Advent-of-Code-2020-Exercises
0
6632525
<reponame>dfwarden/Advent-of-Code-2020-Exercises import copy def run(): ''' File input is a plain text file of lines. First line is estimate of earliest timestamp I could board bus departing seaport. Second line are bus IDs in service that indicate how often the bus departs the seaport. ...
import copy def run(): ''' File input is a plain text file of lines. First line is estimate of earliest timestamp I could board bus departing seaport. Second line are bus IDs in service that indicate how often the bus departs the seaport. ''' with open('input') as f: lines...
en
0.93887
File input is a plain text file of lines. First line is estimate of earliest timestamp I could board bus departing seaport. Second line are bus IDs in service that indicate how often the bus departs the seaport. # index matches busses # `wait_times` should now have the minutes necessary to wait for eac...
3.784919
4
fictitious_play.py
Arnukk/FP_RFP_LH
1
6632526
import numpy import math from scipy import stats def RandomizedFictitiousPlay(A, Epsilon): n = len(A[0]) m = len(A) X = numpy.matrix(numpy.zeros((m, 1), dtype=int)) Y = numpy.matrix(numpy.zeros((n, 1), dtype=int)) X[0] = 1 Y[0] = 1 numpy.random.shuffle(X) numpy.random.shuffle(Y) ...
import numpy import math from scipy import stats def RandomizedFictitiousPlay(A, Epsilon): n = len(A[0]) m = len(A) X = numpy.matrix(numpy.zeros((m, 1), dtype=int)) Y = numpy.matrix(numpy.zeros((n, 1), dtype=int)) X[0] = 1 Y[0] = 1 numpy.random.shuffle(X) numpy.random.shuffle(Y) ...
en
0.275124
#print Ax #print Ay #print xchoice #print X #print ychoice #print Y #print xchoice #print X #print ychoice #print Y #The payoff Matrix #A = numpy.array([[1, 0, 2, -2], [-1, 1, -1, 0]]) #r = 1 #while r >= 0.3: # temp1, temp = RandomizedFictitiousPlay(A, 0.1) # Ax = numpy.array(numpy.transpose(A) * temp1).tolist() ...
3.2824
3
fileutils/xml.py
nicholasding/fileutils
0
6632527
<reponame>nicholasding/fileutils from lxml import etree def fast_iter(context, func): for event, el in context: func(el) el.clear() while el.getprevious() is not None: del el.getparent()[0] del context def iterparse(fp, tag, func): context = etree.iterparse(fp, events=...
from lxml import etree def fast_iter(context, func): for event, el in context: func(el) el.clear() while el.getprevious() is not None: del el.getparent()[0] del context def iterparse(fp, tag, func): context = etree.iterparse(fp, events=('end',), tag=tag) fast_iter(...
none
1
2.742525
3
sollumz_ui.py
Loyalists/Sollumz
4
6632528
<filename>sollumz_ui.py import bpy from .sollumz_helper import * from .sollumz_properties import * class OrderListHelper: orderkey = "name" def filter_items(self, context, data, propname): helper = bpy.types.UI_UL_list items = getattr(data, propname) ordered = helper.sort_items_by_nam...
<filename>sollumz_ui.py import bpy from .sollumz_helper import * from .sollumz_properties import * class OrderListHelper: orderkey = "name" def filter_items(self, context, data, propname): helper = bpy.types.UI_UL_list items = getattr(data, propname) ordered = helper.sort_items_by_nam...
en
0.669385
# Example property to display a checkbox, can be anything # Example property to display a checkbox, can be anything # Example property to display a checkbox, can be anything # Example property to display a checkbox, can be anything # Example property to display a checkbox, can be anything
2.176916
2
Useful scripts/UsefulScripts.py
SathyaKrishnan1211/Medium-Article-Code
0
6632529
<gh_stars>0 import numpy as np import pandas as pd import matplotlib.pyplot as plt from low_key.metrics import precision_binary,recall_binary,accuracy_score,f1_score def train_test_split(X,y,test_size=0.2,random_state=42): """ Accepts only a dataframe or a numpy array as input. :param X: input da...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from low_key.metrics import precision_binary,recall_binary,accuracy_score,f1_score def train_test_split(X,y,test_size=0.2,random_state=42): """ Accepts only a dataframe or a numpy array as input. :param X: input data X :p...
en
0.736494
Accepts only a dataframe or a numpy array as input. :param X: input data X :param y: input data y :param test_size: specifies the size of the test dataset. :param random_state: seed for shuffling the data :return: X_train,X_test,y_train,y_test This is a function that is used to visualize the bo...
3.955219
4
rental/migrations/0001_initial.py
rbed/DjangoOne
0
6632530
<filename>rental/migrations/0001_initial.py # -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-08-10 05:48 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc ...
<filename>rental/migrations/0001_initial.py # -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-08-10 05:48 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc ...
en
0.777942
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-08-10 05:48
1.700906
2
tests/integration/thread_support/test_run.py
pyqgis/plutil
0
6632531
<filename>tests/integration/thread_support/test_run.py # -*- coding: utf-8 -*- """ """ from __future__ import unicode_literals from __future__ import print_function import logging import threading from time import sleep from unittest import TestCase, SkipTest from unittest.mock import MagicMock from PyQt5.QtCore impo...
<filename>tests/integration/thread_support/test_run.py # -*- coding: utf-8 -*- """ """ from __future__ import unicode_literals from __future__ import print_function import logging import threading from time import sleep from unittest import TestCase, SkipTest from unittest.mock import MagicMock from PyQt5.QtCore impo...
en
0.91894
# -*- coding: utf-8 -*- # Set this to terminate the thread. Executed just before the messages leaves the thread side. Executed when the message has reached GUI side.
2.193917
2
Algorithms/Linear Regression/LinearRegression.py
alex0019/ML-Algorithms
7
6632532
<gh_stars>1-10 ############################################################################################################################ ''' Linear Regression implementation in Python 3 By - <NAME> - Using Gradient descent algorithm for finding parameter values. - Without regularizat...
############################################################################################################################ ''' Linear Regression implementation in Python 3 By - <NAME> - Using Gradient descent algorithm for finding parameter values. - Without regularization. :: Variab...
en
0.689926
############################################################################################################################ Linear Regression implementation in Python 3 By - <NAME> - Using Gradient descent algorithm for finding parameter values. - Without regularization. :: Variables used :: 1)...
3.881946
4
tests/lowball/builtins/response_class/test_response_class.py
EmersonElectricCo/lowball
3
6632533
import json from flask import Response from lowball.builtins.response_class import LowballResponse class TestLowballResponseClassForceType: def test_forces_type_properly_for_dicts(self, dict_return_value, client_with_response_class, expected_dict_return): forced_response = LowballResponse.force_type(dic...
import json from flask import Response from lowball.builtins.response_class import LowballResponse class TestLowballResponseClassForceType: def test_forces_type_properly_for_dicts(self, dict_return_value, client_with_response_class, expected_dict_return): forced_response = LowballResponse.force_type(dic...
none
1
2.67082
3
matplotlib_examples/examples_src/pylab_examples/fancyarrow_demo.py
xzlmark/webspider
3
6632534
<filename>matplotlib_examples/examples_src/pylab_examples/fancyarrow_demo.py import matplotlib.patches as mpatches import matplotlib.pyplot as plt styles = mpatches.ArrowStyle.get_styles() ncol = 2 nrow = (len(styles) + 1) // ncol figheight = (nrow + 0.5) fig1 = plt.figure(1, (4.*ncol/1.5, figheight/1.5)) fontsize = ...
<filename>matplotlib_examples/examples_src/pylab_examples/fancyarrow_demo.py import matplotlib.patches as mpatches import matplotlib.pyplot as plt styles = mpatches.ArrowStyle.get_styles() ncol = 2 nrow = (len(styles) + 1) // ncol figheight = (nrow + 0.5) fig1 = plt.figure(1, (4.*ncol/1.5, figheight/1.5)) fontsize = ...
en
0.187068
# /figheight #xycoords="figure fraction", textcoords="figure fraction",
2.349293
2
venv/lib/python3.6/site-packages/ansible_collections/dellemc/openmanage/plugins/modules/idrac_syslog.py
usegalaxy-no/usegalaxy
1
6632535
#!/usr/bin/python # -*- coding: utf-8 -*- # # Dell EMC OpenManage Ansible Modules # Version 3.5.0 # Copyright (C) 2018-2021 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import (absolute_import, divi...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Dell EMC OpenManage Ansible Modules # Version 3.5.0 # Copyright (C) 2018-2021 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import (absolute_import, divi...
en
0.547253
#!/usr/bin/python # -*- coding: utf-8 -*- # # Dell EMC OpenManage Ansible Modules # Version 3.5.0 # Copyright (C) 2018-2021 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # --- module: idrac_syslog short_description: Enabl...
1.473211
1
utils.py
rmcanada/pitcher-release-point
0
6632536
import os import json import urllib.request import subprocess import argparse import shutil parser = argparse.ArgumentParser() parser.add_argument('--guid', help='guid from json of video') json_files = [pos_json for pos_json in os.listdir('.') if pos_json.endswith('.json')] def download_video(url): try: ...
import os import json import urllib.request import subprocess import argparse import shutil parser = argparse.ArgumentParser() parser.add_argument('--guid', help='guid from json of video') json_files = [pos_json for pos_json in os.listdir('.') if pos_json.endswith('.json')] def download_video(url): try: ...
en
0.617637
# check to see that the data pertains to a pitch and not a pickoff # subset info on playback types to iterate through # loop through playback types looking for centrefield camera # create subset of playback data pertaining to current data # if bitrate is higher than current max bitrate, pick # print(max_bit_index) # pr...
2.749222
3
strategies/cdnnc.py
aladics/DeepBugHunter
6
6632537
<filename>strategies/cdnnc.py import os import shutil import math import logging import argparse import tensorflow as tf from tensorflow.python.platform import tf_logging import dbh_util as util import classifier as cl import pandas2tf EPS = 1e-8 CLASSES = 2 def log(msg): tf_logging.log(tf_logging.FATAL, msg) # ...
<filename>strategies/cdnnc.py import os import shutil import math import logging import argparse import tensorflow as tf from tensorflow.python.platform import tf_logging import dbh_util as util import classifier as cl import pandas2tf EPS = 1e-8 CLASSES = 2 def log(msg): tf_logging.log(tf_logging.FATAL, msg) # ...
en
0.753046
# FATAL to show up at any TF logging level # # Strategy args # # # Validate after every epoch, and if the model gets worse, then restore the previous best model and try again # with a reduced (halved) learning rate # # Read strategy-specific args # Clean out the sandbox # Feature columns describe how to use the input #...
2.390537
2
baekjoon/2775.py
DevStarSJ/algorithmExercise
0
6632538
<filename>baekjoon/2775.py def GetNum_timeout(k,n): if k == 0: return n result = 0 for i in range(0,n+1): result += GetNum(k-1, i) return result apt = [] def makeApt(k,n): apt.append([]) for i in range(n): apt[0].append(i+1) for i in range(k-1): apt.append(...
<filename>baekjoon/2775.py def GetNum_timeout(k,n): if k == 0: return n result = 0 for i in range(0,n+1): result += GetNum(k-1, i) return result apt = [] def makeApt(k,n): apt.append([]) for i in range(n): apt[0].append(i+1) for i in range(k-1): apt.append(...
ko
0.469472
# 1호 : 1 # 2호 : 2,3,4,5,6 : k # 3호 : 3, 6, 10, 15 : n + (n+1) + (n+2) ... kn+ 0~n까지 합 # 4호 : 4, 10, 20, 35 : 6, 10, 15
3.218167
3
Data Processing/twitter_model_generation.py
reallyrehan/pollytics
1
6632539
<filename>Data Processing/twitter_model_generation.py import sys if 'google.colab' in sys.modules: !pip install emoji --upgrade !pip install pandas-profiling==2.* !pip install plotly==4.* #!python -m spacy download en_core_web_lg !pip install pyldavis !pip install gensim !pip install chart_s...
<filename>Data Processing/twitter_model_generation.py import sys if 'google.colab' in sys.modules: !pip install emoji --upgrade !pip install pandas-profiling==2.* !pip install plotly==4.* #!python -m spacy download en_core_web_lg !pip install pyldavis !pip install gensim !pip install chart_s...
en
0.553853
#!python -m spacy download en_core_web_lg #Base and Cleaning #Visualizations #Natural Language Processing (NLP) Removes emoji's from tweets Accepts: Text (tweets) Returns: Text (emoji free tweets) Cleans text from urls # Makes tokens column # Instantiating a Base LDA model # Getting the topics #...
2.386329
2
Code python/Pycharm/texte_optimisation.py
Thomaw/Rubik-s-cube-solver
0
6632540
<filename>Code python/Pycharm/texte_optimisation.py import re ''' Cette fonction va nous permettre de simplifier la réception du message Arduino avant de le transmettre à l'afficheur Cette fonction ne sera pas expliquée en détail, car c'est simplement une modification longue et sinueuse du message Arduino ayan...
<filename>Code python/Pycharm/texte_optimisation.py import re ''' Cette fonction va nous permettre de simplifier la réception du message Arduino avant de le transmettre à l'afficheur Cette fonction ne sera pas expliquée en détail, car c'est simplement une modification longue et sinueuse du message Arduino ayan...
fr
0.963574
Cette fonction va nous permettre de simplifier la réception du message Arduino avant de le transmettre à l'afficheur Cette fonction ne sera pas expliquée en détail, car c'est simplement une modification longue et sinueuse du message Arduino ayant pour objectif principal d'enlever les imperfections pour créer quelq...
3.092973
3
grid_user/ajax.py
topd333/Xlab
0
6632541
from django.http import HttpResponse, HttpResponseRedirect import json from django.core.mail import send_mail from django.core.exceptions import ObjectDoesNotExist from string import letters, digits import random from random import choice from django.conf import settings from grid_user.forms import CreateUserForm impor...
from django.http import HttpResponse, HttpResponseRedirect import json from django.core.mail import send_mail from django.core.exceptions import ObjectDoesNotExist from string import letters, digits import random from random import choice from django.conf import settings from grid_user.forms import CreateUserForm impor...
en
0.403739
# Test for existing email / avatar name locally # Test for existing user on grid #if xtest != '': # Attempt to create a temporary user # try: # tmp_user = TempUser.objects.create_temp_user( # data['email'], data['firstname'], data['lastname'], # key, data['password'] # ) # activate_link = '%s:%s...
2.11582
2
OOP/Dog.py
zxg110/PythonGrammer
0
6632542
<reponame>zxg110/PythonGrammer from OOP import Animal class Dog(Animal.Animal): def __init__(self, name, level, age): #调用父类的构造函数写法 Animal.__init__(name,level) self.age = age dog = Dog('tom',1,23) print("Dog age:",dog.age,"Dog name:",dog.name) print(type(dog))
from OOP import Animal class Dog(Animal.Animal): def __init__(self, name, level, age): #调用父类的构造函数写法 Animal.__init__(name,level) self.age = age dog = Dog('tom',1,23) print("Dog age:",dog.age,"Dog name:",dog.name) print(type(dog))
zh
0.774019
#调用父类的构造函数写法
3.897112
4
xjsonrpc/server/dispatcher.py
bernhardkaindl/pjrpc
0
6632543
<filename>xjsonrpc/server/dispatcher.py<gh_stars>0 import asyncio import functools as ft import json import itertools as it import logging from typing import Any, Callable, Dict, ItemsView, KeysView, List, Optional, Type, Iterator, Iterable, Union, ValuesView from typing import cast, TypeVar import xjsonrpc from xjson...
<filename>xjsonrpc/server/dispatcher.py<gh_stars>0 import asyncio import functools as ft import json import itertools as it import logging from typing import Any, Callable, Dict, ItemsView, KeysView, List, Optional, Type, Iterator, Iterable, Union, ValuesView from typing import cast, TypeVar import xjsonrpc from xjson...
en
0.709107
JSON-RPC method wrapper. Stores method itself and some metainformation. :param method: method :param name: method name :param context: context name # sourcery skip: dict-assign-update-to-union # sourcery skip: assign-if-exp, reintroduce-else, swap-if-expression View method. :param view_cls: view class...
1.998961
2
exploit/cms_discuz_7_2_sortid_sql_injection.py
Micr067/pentestdb
686
6632544
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' Pentestdb, a database for penetration test. Copyright (c) 2015 alpha1e0 ''' from pentest.libs.exploit import Exploit from pentest.libs.exploit import Result class DiscuzSI(Exploit): expName = u"Discuz 7.2 主题分类 SQL注入" version = "1.0" author = "alpha1e0" ...
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' Pentestdb, a database for penetration test. Copyright (c) 2015 alpha1e0 ''' from pentest.libs.exploit import Exploit from pentest.libs.exploit import Result class DiscuzSI(Exploit): expName = u"Discuz 7.2 主题分类 SQL注入" version = "1.0" author = "alpha1e0" ...
zh
0.255431
#!/usr/bin/env python #-*- coding:utf-8 -*- Pentestdb, a database for penetration test. Copyright (c) 2015 alpha1e0 该exploit未验证通过 漏洞利用条件:1.Discuz 7.2,2.开启主题分类;2.登陆 #".format(sig),
2.38675
2
blog/models.py
siyingcheng/bAd-Robot
0
6632545
import markdown from django.contrib.auth.models import User from django.db import models from django.urls import reverse from django.utils.html import strip_tags from mdeditor.fields import MDTextField class Category(models.Model): name = models.CharField(max_length=64) class Meta: verbose_name = '分类...
import markdown from django.contrib.auth.models import User from django.db import models from django.urls import reverse from django.utils.html import strip_tags from mdeditor.fields import MDTextField class Category(models.Model): name = models.CharField(max_length=64) class Meta: verbose_name = '分类...
zh
0.968222
# body = models.TextField('正文') # 首先实例化一个 Markdown 类,用于渲染 body 的文本。 # 由于摘要并不需要生成文章目录,所以去掉了目录拓展。 # 先将 Markdown 文本渲染成 HTML 文本 # strip_tags 去掉 HTML 文本的全部 HTML 标签 # 从文本摘取前 54 个字符赋给 excerpt
2.230637
2
src/pretalx/person/migrations/0030_auto_20211127_0152.py
lili668668/pretalx
0
6632546
<reponame>lili668668/pretalx # Generated by Django 3.2.8 on 2021-11-27 01:52 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('submission', '0063_remove_track_color'), ('person', '0029_contact_track'), ] o...
# Generated by Django 3.2.8 on 2021-11-27 01:52 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('submission', '0063_remove_track_color'), ('person', '0029_contact_track'), ] operations = [ migrati...
en
0.905643
# Generated by Django 3.2.8 on 2021-11-27 01:52
1.459703
1
jupyterhub_configurator_config.py
GeorgianaElena/jupyterhub-configurator
1
6632547
import os import json HERE = os.path.dirname(os.path.abspath(__file__)) c.Configurator.selected_fields = ["z2jh.image", "z2jh.default_interface"]
import os import json HERE = os.path.dirname(os.path.abspath(__file__)) c.Configurator.selected_fields = ["z2jh.image", "z2jh.default_interface"]
none
1
1.703809
2
MissingPersons/urls.py
sriramcu/MissingPersonsTracing
0
6632548
<gh_stars>0 """django_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='...
"""django_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class...
en
0.545488
django_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-ba...
2.438789
2
Assignment5.py
AnkurDesai11/PY4E
0
6632549
''' Created on 16 Aug, 2020 @author: ABD ''' largest = None smallest = None num = None inp = None while inp!='done' : try : inp = input("Enter a number: ") if inp=='done' : break num = int(inp) if largest==None : largest=num if smallest==None : ...
''' Created on 16 Aug, 2020 @author: ABD ''' largest = None smallest = None num = None inp = None while inp!='done' : try : inp = input("Enter a number: ") if inp=='done' : break num = int(inp) if largest==None : largest=num if smallest==None : ...
en
0.705805
Created on 16 Aug, 2020 @author: ABD
3.963786
4
python/weibo/ajax.py
fengyuanzemin/spider-example
0
6632550
import requests from urllib.parse import urlencode from pyquery import PyQuery as pq import time base_url = 'https://m.weibo.cn/api/container/getIndex?' headers = { 'Host': 'm.weibo.cn', 'Referer': 'https://m.weibo.cn/u/2830678474', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit...
import requests from urllib.parse import urlencode from pyquery import PyQuery as pq import time base_url = 'https://m.weibo.cn/api/container/getIndex?' headers = { 'Host': 'm.weibo.cn', 'Referer': 'https://m.weibo.cn/u/2830678474', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit...
zh
0.995915
# 不先添加到文件中了
2.981446
3