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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/unit/plain/test_splitting.py | Goorman/pygbm | 0 | 6627551 | import numpy as np
from numpy.testing import assert_almost_equal
from numpy.testing import assert_array_almost_equal
import pytest
from pygbm.plain.splitting import _find_histogram_split
from pygbm.plain.splitting import (SplittingContext, find_node_split,
find_node_split_subtraction,
... | import numpy as np
from numpy.testing import assert_almost_equal
from numpy.testing import assert_array_almost_equal
import pytest
from pygbm.plain.splitting import _find_histogram_split
from pygbm.plain.splitting import (SplittingContext, find_node_split,
find_node_split_subtraction,
... | en | 0.901369 | # Constant hessian: 1. per sample. # Make sure find_node_split and find_node_split_subtraction return the # same results. # Should we add a test about computation time to make sure # time(subtraction) < time(regular)? # first split parent, left and right with classical method # split left with subtraction method # spli... | 2.287123 | 2 |
ironic/drivers/fake_hardware.py | dangervon/ironic | 0 | 6627552 | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | en | 0.8504 | # Copyright 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin... | 1.742792 | 2 |
test/aqua/operators/test_evolution.py | Milos9304/qiskit-aqua | 2 | 6627553 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# 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 modifications or derivat... | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# 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 modifications or derivat... | en | 0.739051 | # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2020. # # 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 modifications or derivat... | 1.99005 | 2 |
frappe/core/doctype/transaction_log/test_transaction_log.py | erpnext-tm/frappe | 0 | 6627554 | <filename>frappe/core/doctype/transaction_log/test_transaction_log.py
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import hashlib
import unittest
import frappe
test_records = []
class TestTransactionLog(unittest.TestCas... | <filename>frappe/core/doctype/transaction_log/test_transaction_log.py
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import hashlib
import unittest
import frappe
test_records = []
class TestTransactionLog(unittest.TestCas... | en | 0.718929 | # -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies and Contributors # See license.txt | 2.203094 | 2 |
tornadoredis/tests/pipeline.py | jbochi/tornado-redis | 1 | 6627555 | #!/usr/bin/env python
from tornado import gen
from redistest import RedisTestCase, async_test
from tornadoredis.exceptions import ResponseError
class PipelineTestCase(RedisTestCase):
@async_test
@gen.engine
def test_pipe_simple(self):
pipe = self.client.pipeline()
pipe.set('foo', '123')
... | #!/usr/bin/env python
from tornado import gen
from redistest import RedisTestCase, async_test
from tornadoredis.exceptions import ResponseError
class PipelineTestCase(RedisTestCase):
@async_test
@gen.engine
def test_pipe_simple(self):
pipe = self.client.pipeline()
pipe.set('foo', '123')
... | ru | 0.26433 | #!/usr/bin/env python | 2.320764 | 2 |
tensorflow_probability/python/internal/name_util.py | Frightera/probability | 1 | 6627556 | # Copyright 2018 The TensorFlow Probability 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 applicable law o... | # Copyright 2018 The TensorFlow Probability 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 applicable law o... | en | 0.830723 | # Copyright 2018 The TensorFlow Probability 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 applicable law o... | 2.131526 | 2 |
melodic/lib/turtle_tf/turtle_tf_message_broadcaster.py | Dieptranivsr/Ros_Diep | 2 | 6627557 | <reponame>Dieptranivsr/Ros_Diep<filename>melodic/lib/turtle_tf/turtle_tf_message_broadcaster.py
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitte... | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must r... | en | 0.696197 | #!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, <NAME>, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must r... | 1.756127 | 2 |
src/05_ptb_rnn/RNN.py | corochann/deep-learning-tutorial-with-chainer | 31 | 6627558 | import chainer
import chainer.functions as F
import chainer.links as L
class RNN(chainer.Chain):
"""Simple Recurrent Neural Network implementation"""
def __init__(self, n_vocab, n_units):
super(RNN, self).__init__()
with self.init_scope():
self.embed = L.EmbedID(n_vocab, n_units)
... | import chainer
import chainer.functions as F
import chainer.links as L
class RNN(chainer.Chain):
"""Simple Recurrent Neural Network implementation"""
def __init__(self, n_vocab, n_units):
super(RNN, self).__init__()
with self.init_scope():
self.embed = L.EmbedID(n_vocab, n_units)
... | en | 0.577915 | Simple Recurrent Neural Network implementation | 3.43484 | 3 |
experiments/add/add.py | namin/d4 | 42 | 6627559 | <filename>experiments/add/add.py<gh_stars>10-100
from collections import namedtuple
import numpy as np
import tensorflow as tf
from experiments.nam_seq2seq import NAMSeq2Seq
from experiments.data import load_data, DatasetBatcher
# logging.basicConfig(level=logging.DEBUG)
np.set_printoptions(linewidth=20000, precis... | <filename>experiments/add/add.py<gh_stars>10-100
from collections import namedtuple
import numpy as np
import tensorflow as tf
from experiments.nam_seq2seq import NAMSeq2Seq
from experiments.data import load_data, DatasetBatcher
# logging.basicConfig(level=logging.DEBUG)
np.set_printoptions(linewidth=20000, precis... | en | 0.381161 | # logging.basicConfig(level=logging.DEBUG) # num_steps = seq_length * 6 + 6 # stack_size = seq_length * 2 + 10 # # seq_len = 1 # num_steps = 12 # stack_size = 12 # seq_length = 3 # num_steps = 24 # stack_size = 16 # seq_length = 10 # num_steps = 66 # stack_size = 30 # choose add - learning rate 0.05 # calculate value_s... | 2.429155 | 2 |
iotic_chat/main.py | aniknarayan/iotic_work | 0 | 6627560 | <filename>iotic_chat/main.py
# Copyright (c) 2017 Iotic Labs Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/Iotic-Labs/py-application-exa... | <filename>iotic_chat/main.py
# Copyright (c) 2017 Iotic Labs Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/Iotic-Labs/py-application-exa... | en | 0.594768 | # Copyright (c) 2017 Iotic Labs Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://github.com/Iotic-Labs/py-application-examples/blob/master/LICENSE # #... | 1.798307 | 2 |
llcv/models/detectors/__init__.py | mtli/llcv | 1 | 6627561 | <gh_stars>1-10
from .tv_dets import TVFasterRCNN
| from .tv_dets import TVFasterRCNN | none | 1 | 1.079502 | 1 | |
tests/link_tests.py | notconfusing/pywikibot-fr-welcome-bot | 1 | 6627562 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""Test Link functionality."""
#
# (C) Pywikibot team, 2014-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import re
import pywikibot
from pywikibot import config2 as config
from pywikibot import Sit... | # -*- coding: utf-8 -*-
"""Test Link functionality."""
#
# (C) Pywikibot team, 2014-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import re
import pywikibot
from pywikibot import config2 as config
from pywikibot import Site
from pywikibo... | en | 0.730256 | # -*- coding: utf-8 -*- Test Link functionality. # # (C) Pywikibot team, 2014-2019 # # Distributed under the terms of the MIT license. # Test C{Link.create_separated}. Test the separate contents of the link. Test combinations of parameters. # ---- Tests checking if the parser does (not) accept (in)valid titles Test par... | 2.544282 | 3 |
src/docker-images/collectd/kubernetes_collectd.py | resouer/DLWorkspace | 0 | 6627563 | <gh_stars>0
#!/usr/bin/env python
import collectd
import json
import os
import subprocess
import sys
import yaml
import re
import pycurl
from StringIO import StringIO
import traceback
def curl_get(url):
curl = pycurl.Curl()
curl.setopt(pycurl.URL, url)
curl.setopt(pycurl.SSL_VERIFYPEER, 1)
curl.s... | #!/usr/bin/env python
import collectd
import json
import os
import subprocess
import sys
import yaml
import re
import pycurl
from StringIO import StringIO
import traceback
def curl_get(url):
curl = pycurl.Curl()
curl.setopt(pycurl.URL, url)
curl.setopt(pycurl.SSL_VERIFYPEER, 1)
curl.setopt(pycurl... | ru | 0.26433 | #!/usr/bin/env python | 2.067993 | 2 |
echopype/convert/set_groups_base.py | mbdunn/echopype | 0 | 6627564 | <reponame>mbdunn/echopype
import abc
from typing import Set
import numpy as np
import pynmea2
import xarray as xr
from ..echodata.convention import sonarnetcdf_1
from ..utils.coding import COMPRESSION_SETTINGS, set_encodings
from ..utils.prov import echopype_prov_attrs, source_files_vars
DEFAULT_CHUNK_SIZE = {"range... | import abc
from typing import Set
import numpy as np
import pynmea2
import xarray as xr
from ..echodata.convention import sonarnetcdf_1
from ..utils.coding import COMPRESSION_SETTINGS, set_encodings
from ..utils.prov import echopype_prov_attrs, source_files_vars
DEFAULT_CHUNK_SIZE = {"range_sample": 25000, "ping_tim... | en | 0.735876 | Base class for saving groups to netcdf or zarr from echosounder data files. # parser object ParseEK60/ParseAZFP/etc... # Used for when a sonar that is not AZFP/EK60/EK80 can still be saved # self._beamgroups must be a list of dicts, eg: # [{"name":"Beam_group1", "descr":"contains complex backscatter data # and other be... | 2.371644 | 2 |
nsd1803/python/day12/get_web2.py | MrWangwf/nsd1806 | 0 | 6627565 | <reponame>MrWangwf/nsd1806
'为了防止由于服务器限制,不能通过程序爬取页面,模拟使用Firefox浏览'
from urllib import request
url = 'http://127.0.0.1/'
header = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'
}
r = request.Request(url, headers=header)
html = request.urlopen(r)
data = html.read()
print(data.d... | '为了防止由于服务器限制,不能通过程序爬取页面,模拟使用Firefox浏览'
from urllib import request
url = 'http://127.0.0.1/'
header = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'
}
r = request.Request(url, headers=header)
html = request.urlopen(r)
data = html.read()
print(data.decode('utf8'))
# tail -f /... | en | 0.587914 | # tail -f /var/log/httpd/access_log | 2.564031 | 3 |
python/paddle/fluid/tests/unittests/test_concat_op.py | L-Net-1992/Paddle | 11 | 6627566 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | en | 0.744374 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app... | 2.103484 | 2 |
jacinle/storage/kv/mem.py | dapatil211/Jacinle | 114 | 6627567 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : mem.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 01/19/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
from .kv import KVStoreBase
class MemKVStore(KVStoreBase):
def __init__(self, readonly=False):
super... | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : mem.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 01/19/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
from .kv import KVStoreBase
class MemKVStore(KVStoreBase):
def __init__(self, readonly=False):
super... | en | 0.571194 | #! /usr/bin/env python3 # -*- coding: utf-8 -*- # File : mem.py # Author : <NAME> # Email : <EMAIL> # Date : 01/19/2018 # # This file is part of Jacinle. # Distributed under terms of the MIT license. | 2.367586 | 2 |
AccFocEnv/AccFocEnv.py | mbroso/constraintnet_foc | 0 | 6627568 | <filename>AccFocEnv/AccFocEnv.py
"""This module implements a simulated follow object control environment following OpenAI Gym interface.
"""
import math
import numpy as np
import gym
from gym import error, spaces
from gym.utils import seeding
import matplotlib.pyplot as plt
import time
from tqdm import tqdm
... | <filename>AccFocEnv/AccFocEnv.py
"""This module implements a simulated follow object control environment following OpenAI Gym interface.
"""
import math
import numpy as np
import gym
from gym import error, spaces
from gym.utils import seeding
import matplotlib.pyplot as plt
import time
from tqdm import tqdm
... | en | 0.797996 | This module implements a simulated follow object control environment following OpenAI Gym interface. Custom environment for follow object control that follows OpenAI gym interface Initialize environment
Args:
opts: Namespace object with options.
plotter: Plotter object to enable plo... | 2.617531 | 3 |
python/src/problem/leetcode/easy/leetcode_700.py | yipwinghong/Algorithm | 9 | 6627569 | <reponame>yipwinghong/Algorithm
# coding=utf-8
from src.data_structure.data_structure import TreeNode
class Solution:
"""
另一个树的子树
"""
def search_bst(self, root: TreeNode, val: int) -> TreeNode:
"""
Time: O(h), Space: O(1)
:param root:
:param val:
:return:
... | # coding=utf-8
from src.data_structure.data_structure import TreeNode
class Solution:
"""
另一个树的子树
"""
def search_bst(self, root: TreeNode, val: int) -> TreeNode:
"""
Time: O(h), Space: O(1)
:param root:
:param val:
:return:
"""
while root and ro... | en | 0.29398 | # coding=utf-8 另一个树的子树 Time: O(h), Space: O(1) :param root: :param val: :return: | 3.51216 | 4 |
test/unit/util/test_utils.py | Tomasz69/galaxy | 1 | 6627570 | <reponame>Tomasz69/galaxy
import errno
import os
import tempfile
import pytest
from galaxy import util
SECTION_XML = """<?xml version="1.0" ?>
<section id="fasta_fastq_manipulation" name="Fasta Fastq Manipulation" version="">
<tool file="toolshed.g2.bx.psu.edu/repos/peterjc/seq_filter_by_id/fb1313d79396/seq_filt... | import errno
import os
import tempfile
import pytest
from galaxy import util
SECTION_XML = """<?xml version="1.0" ?>
<section id="fasta_fastq_manipulation" name="Fasta Fastq Manipulation" version="">
<tool file="toolshed.g2.bx.psu.edu/repos/peterjc/seq_filter_by_id/fb1313d79396/seq_filter_by_id/tools/seq_filter_... | en | 0.577461 | <?xml version="1.0" ?> <section id="fasta_fastq_manipulation" name="Fasta Fastq Manipulation" version=""> <tool file="toolshed.g2.bx.psu.edu/repos/peterjc/seq_filter_by_id/fb1313d79396/seq_filter_by_id/tools/seq_filter_by_id/seq_filter_by_id.xml" guid="toolshed.g2.bx.psu.edu/repos/peterjc/seq_filter_by_id/seq_filte... | 2.317138 | 2 |
.venv/lib/python3.8/site-packages/opencensus/trace/tracer.py | MarkusMeyer13/graph-teams-presence | 0 | 6627571 | # Copyright 2017, OpenCensus 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 applicable law or agreed... | # Copyright 2017, OpenCensus 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 applicable law or agreed... | en | 0.626857 | # Copyright 2017, OpenCensus 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 applicable law or agreed to in w... | 1.879661 | 2 |
pyDdos.py | leak37/pyDdos | 0 | 6627572 | #Made by Leak#5749
#Contributed to github
#Special thanks to NumeX
import sys
import os
import time
import socket
import random
from datetime import datetime
now = datetime.now()
hour = now.hour
minute = now.minute
day = now.day
month = now.month
year = now.year
##############
sock = socket.socket... | #Made by Leak#5749
#Contributed to github
#Special thanks to NumeX
import sys
import os
import time
import socket
import random
from datetime import datetime
now = datetime.now()
hour = now.hour
minute = now.minute
day = now.day
month = now.month
year = now.year
##############
sock = socket.socket... | en | 0.569365 | #Made by Leak#5749 #Contributed to github #Special thanks to NumeX ############## ############# #5749") | 2.586241 | 3 |
accounts/migrations/0001_initial.py | JulienPalard/PonyConf | 11 | 6627573 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-11-18 20:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
def profile_forward(apps, schema_editor):
User = apps.get_model(settings.AUTH_USER_MODEL)
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-11-18 20:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
def profile_forward(apps, schema_editor):
User = apps.get_model(settings.AUTH_USER_MODEL)
... | en | 0.663569 | # -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-11-18 20:14 | 1.957031 | 2 |
sdv/lite/tabular.py | HDI-Project/SDV | 39 | 6627574 | <reponame>HDI-Project/SDV<filename>sdv/lite/tabular.py
"""Base class for tabular model presets."""
import logging
import pickle
import sys
import warnings
import numpy as np
import rdt
from sdv.metadata import Table
from sdv.tabular import GaussianCopula
from sdv.utils import get_package_versions, throw_version_mism... | """Base class for tabular model presets."""
import logging
import pickle
import sys
import warnings
import numpy as np
import rdt
from sdv.metadata import Table
from sdv.tabular import GaussianCopula
from sdv.utils import get_package_versions, throw_version_mismatch_warning
LOGGER = logging.getLogger(__name__)
FAS... | en | 0.749241 | Base class for tabular model presets. Class for all tabular model presets. Args: name (str): The preset to use. metadata (dict or metadata.Table): Table metadata instance or dict representation. constraints (list[Constraint, dict]): List of Constraint obj... | 2.372908 | 2 |
online/section02-2.py | djangojeng-e/Web-Crawling | 0 | 6627575 | # Section02-2
# 파이썬 크롤링 기초
# URLOPEN 함수 기초 사용법
import urllib.request as req
from urllib.error import URLError, HTTPError
# 다운로드 경로 및 파일명
path_list = ["test1.jpg", "index.html"]
# 다운로드 리소스 url
target_url = ["http://post.phinf.naver.net/MjAxOTA2MDdfMTU0/MDAxNTU5ODcxODc3NTU0.4SFrd6PeWF62ewm21H4nu5xae67wvpvVe2V... | # Section02-2
# 파이썬 크롤링 기초
# URLOPEN 함수 기초 사용법
import urllib.request as req
from urllib.error import URLError, HTTPError
# 다운로드 경로 및 파일명
path_list = ["test1.jpg", "index.html"]
# 다운로드 리소스 url
target_url = ["http://post.phinf.naver.net/MjAxOTA2MDdfMTU0/MDAxNTU5ODcxODc3NTU0.4SFrd6PeWF62ewm21H4nu5xae67wvpvVe2V... | ko | 1.000069 | # Section02-2 # 파이썬 크롤링 기초 # URLOPEN 함수 기초 사용법 # 다운로드 경로 및 파일명 # 다운로드 리소스 url # ㅇㅖ외처리 # 웹 수신 정보 읽기 # 수신 내용 #성공 # 상태 정보 중간 출력 | 3.217454 | 3 |
src/rebuild.py | KrusnikViers/MineMap | 5 | 6627576 | <filename>src/rebuild.py
#!/usr/bin/python3
import json
import os
import shutil
import subprocess
import time
import requests
from settings import MINECRAFT_TEXTURES_PATH, WORLD_BACKUP_PATH, LOG_FILE_PATH, RENDER_CONFIGURATION_FILE_PATH
class RebuildException(Exception):
pass
def _retry_on_timeout(lambda_f):
... | <filename>src/rebuild.py
#!/usr/bin/python3
import json
import os
import shutil
import subprocess
import time
import requests
from settings import MINECRAFT_TEXTURES_PATH, WORLD_BACKUP_PATH, LOG_FILE_PATH, RENDER_CONFIGURATION_FILE_PATH
class RebuildException(Exception):
pass
def _retry_on_timeout(lambda_f):
... | en | 0.841845 | #!/usr/bin/python3 # Download file from |url| to |location| # GET or POST request on specified url, expects JSON as an answer. # Execute sequence of shell commands, stops and raises exception, if one of them returned non-zero result. # Class for rebuilding a Minecraft map using the minecraft-overviewer. It is caching s... | 2.642788 | 3 |
togglws/values.py | champion-automatica/toggl_webhooks | 10 | 6627577 |
# Possible actions returned by the Toggl server
A_INSERT = 'INSERT'
A_UPDATE = 'UPDATE'
A_DELETE = 'DELETE'
# Possible models returned by the Toggl server
M_TIME_ENTRY = 'time_entry'
M_PROJECT = 'project'
M_TASK = 'task'
M_CLIENT = 'client'
M_TAG = 'tag'
|
# Possible actions returned by the Toggl server
A_INSERT = 'INSERT'
A_UPDATE = 'UPDATE'
A_DELETE = 'DELETE'
# Possible models returned by the Toggl server
M_TIME_ENTRY = 'time_entry'
M_PROJECT = 'project'
M_TASK = 'task'
M_CLIENT = 'client'
M_TAG = 'tag'
| en | 0.90832 | # Possible actions returned by the Toggl server # Possible models returned by the Toggl server | 1.121084 | 1 |
tests/src/year2021/test_day14b.py | lancelote/advent_of_code | 10 | 6627578 | """2021 - Day 14 Part 2: Extended Polymerization."""
from textwrap import dedent
from src.year2021.day14b import solve
def test_solve():
task = dedent(
"""
NNCB
CH -> B
HH -> N
CB -> H
NH -> C
HB -> C
HC -> B
HN -> C
NN -> C
... | """2021 - Day 14 Part 2: Extended Polymerization."""
from textwrap import dedent
from src.year2021.day14b import solve
def test_solve():
task = dedent(
"""
NNCB
CH -> B
HH -> N
CB -> H
NH -> C
HB -> C
HC -> B
HN -> C
NN -> C
... | en | 0.525638 | 2021 - Day 14 Part 2: Extended Polymerization. NNCB CH -> B HH -> N CB -> H NH -> C HB -> C HC -> B HN -> C NN -> C BH -> H NC -> B NB -> B BN -> B BB -> N BC -> B CC -> N CN -> C | 2.496816 | 2 |
open_spiel/python/games/iterated_prisoners_dilemma_test.py | xiaohangt/open_spiel | 0 | 6627579 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | en | 0.863941 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl... | 2.543876 | 3 |
Task/Shell-one-liner/Python/shell-one-liner-2.py | LaudateCorpus1/RosettaCodeData | 1 | 6627580 | python -m CGIHTTPServer
| python -m CGIHTTPServer
| none | 1 | 1.087753 | 1 | |
viberio/types/messages/message.py | bostud/Viber_bot | 0 | 6627581 | import attr
from viberio.types.base import ViberBaseObject
@attr.s
class Message(ViberBaseObject):
tracking_data: str = attr.ib(default=None)
keyboard: str = attr.ib(default=None)
min_api_version: str = attr.ib(default=None)
alt_text: str = attr.ib(default=None)
@attr.s
class TypedMessage(Message):... | import attr
from viberio.types.base import ViberBaseObject
@attr.s
class Message(ViberBaseObject):
tracking_data: str = attr.ib(default=None)
keyboard: str = attr.ib(default=None)
min_api_version: str = attr.ib(default=None)
alt_text: str = attr.ib(default=None)
@attr.s
class TypedMessage(Message):... | none | 1 | 2.361694 | 2 | |
sdc/rewrites/read_csv_consts.py | Vyacheslav-Smirnov/hpat | 0 | 6627582 | # *****************************************************************************
# Copyright (c) 2020, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sou... | # *****************************************************************************
# Copyright (c) 2020, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sou... | en | 0.672164 | # ***************************************************************************** # Copyright (c) 2020, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of sou... | 1.314286 | 1 |
devito/types/dense.py | fffarias/devito-1 | 199 | 6627583 | from collections import namedtuple
from ctypes import POINTER, Structure, c_void_p, c_int, cast, byref
from functools import wraps, reduce
from math import ceil
from operator import mul
import numpy as np
import sympy
from psutil import virtual_memory
from cached_property import cached_property
from cgen import Struct... | from collections import namedtuple
from ctypes import POINTER, Structure, c_void_p, c_int, cast, byref
from functools import wraps, reduce
from math import ceil
from operator import mul
import numpy as np
import sympy
from psutil import virtual_memory
from cached_property import cached_property
from cgen import Struct... | en | 0.795372 | Tensor symbol representing a discrete function in symbolic equations. Unlike an Array, a DiscreteFunction carries data. Notes ----- Users should not instantiate this class directly. Use Function or SparseFunction (or their subclasses) instead. # Required by SymPy, otherwise the presence of __getite... | 1.879975 | 2 |
TFLCycles/unfinished/fourier.py | stanton119/data-analysis | 0 | 6627584 | <reponame>stanton119/data-analysis<filename>TFLCycles/unfinished/fourier.py
# %% Time results using fft
import numpy as np
import scipy.fftpack
# Number of samplepoints
N = 600
# sample spacing
T = 1.0 / 800.0
x = np.linspace(0.0, N * T, N)
y = np.sin(50.0 * 2.0 * np.pi * x) + 0.5 * np.sin(80.0 * 2.0 * np.pi * x... | # %% Time results using fft
import numpy as np
import scipy.fftpack
# Number of samplepoints
N = 600
# sample spacing
T = 1.0 / 800.0
x = np.linspace(0.0, N * T, N)
y = np.sin(50.0 * 2.0 * np.pi * x) + 0.5 * np.sin(80.0 * 2.0 * np.pi * x)
yf = scipy.fftpack.fft(y)
xf = np.linspace(0.0, 1.0 / (2.0 * T), int(N / 2))
pl... | en | 0.538583 | # %% Time results using fft # Number of samplepoints # sample spacing # np.linspace(0.0, 1.0/(2.0*T), int(N/2)) # %% [markdown] # Convert to jupyter notebook -> Export current (no output) # # Convert to markdown file # `jupyter nbconvert data_proc.ipynb --to markdown` | 2.384575 | 2 |
experiments/sb3_grid4x4.py | evantancy/sumo-rl | 0 | 6627585 | <reponame>evantancy/sumo-rl
from stable_baselines3 import PPO
import sumo_rl
import supersuit as ss
from stable_baselines3.common.vec_env import VecMonitor
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.common.callbacks import EvalCallback
import numpy as np
if __name__ == "__m... | from stable_baselines3 import PPO
import sumo_rl
import supersuit as ss
from stable_baselines3.common.vec_env import VecMonitor
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.common.callbacks import EvalCallback
import numpy as np
if __name__ == "__main__":
env = sumo_rl.g... | none | 1 | 1.79698 | 2 | |
merlion/transform/resample.py | ankitakashyap05/Merlion | 1 | 6627586 | <filename>merlion/transform/resample.py
#
# Copyright (c) 2021 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
Transforms that resample the input in time, or stack adj... | <filename>merlion/transform/resample.py
#
# Copyright (c) 2021 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
Transforms that resample the input in time, or stack adj... | en | 0.816088 | # # Copyright (c) 2021 salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause # Transforms that resample the input in time, or stack adjacent observations into vectors. Defines a p... | 2.445894 | 2 |
evaluation.py | MingR-Ma/SEN-FCB | 0 | 6627587 | <filename>evaluation.py
"""Used for evaluate the registration performance"""
import numpy as np
import pystrum.pynd.ndutils as nd
def dice(array1, array2, labels):
"""
:parameter array1: input fixed or warped image.
:parameter array2: input warped or fixed image.
:parameter labels: type: 'list', the ... | <filename>evaluation.py
"""Used for evaluate the registration performance"""
import numpy as np
import pystrum.pynd.ndutils as nd
def dice(array1, array2, labels):
"""
:parameter array1: input fixed or warped image.
:parameter array2: input warped or fixed image.
:parameter labels: type: 'list', the ... | en | 0.636025 | Used for evaluate the registration performance :parameter array1: input fixed or warped image. :parameter array2: input warped or fixed image. :parameter labels: type: 'list', the unique label number in one image pair. Computes the dice overlap between two arrays for a given set of integer labels. :retu... | 2.926275 | 3 |
calculadoraTemp.py | Danieldevop/Python-examples | 0 | 6627588 | <reponame>Danieldevop/Python-examples<filename>calculadoraTemp.py
# -*- coding:utf-8 -*-
def average_temps(temps):
sum_of_temps = 0
for temp in temps:
sum_of_temps += float(temp)
return sum_of_temps / len(temps)
if __name__ == '__main__':
temps = [21, 24, 24, 22, 20, 23, 24]
average = average_temps(temps... | # -*- coding:utf-8 -*-
def average_temps(temps):
sum_of_temps = 0
for temp in temps:
sum_of_temps += float(temp)
return sum_of_temps / len(temps)
if __name__ == '__main__':
temps = [21, 24, 24, 22, 20, 23, 24]
average = average_temps(temps)
print("la temp promedio es: {}".format(average)) | en | 0.736017 | # -*- coding:utf-8 -*- | 3.846793 | 4 |
src/python/grpcio_tests/tests/unit/_empty_message_test.py | duanwujie/grpc-hacking | 9 | 6627589 | <reponame>duanwujie/grpc-hacking
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, ... | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | en | 0.718275 | # Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f... | 1.423991 | 1 |
tests/test_noop_blocks.py | Kyle-Kyle/angr | 6,132 | 6627590 |
import archinfo
import angr
from angr.analyses.cfg import CFGBase
def test_x86_noop_blocks():
# nop
arch = archinfo.arch_from_id("x86")
b = b"\x90\x90\x90\x90\x90\x90\x90\x90"
p = angr.load_shellcode(b, arch, load_address=0x400000)
block = p.factory.block(0x400000, opt_level=1, cross_insn_opt=Fa... |
import archinfo
import angr
from angr.analyses.cfg import CFGBase
def test_x86_noop_blocks():
# nop
arch = archinfo.arch_from_id("x86")
b = b"\x90\x90\x90\x90\x90\x90\x90\x90"
p = angr.load_shellcode(b, arch, load_address=0x400000)
block = p.factory.block(0x400000, opt_level=1, cross_insn_opt=Fa... | bn | 0.127037 | # nop # nop # andeq r0, r0, r0 # mov r0, r0 | 2.138833 | 2 |
qwe.py | csjlxy888/test10086 | 0 | 6627591 | <reponame>csjlxy888/test10086<gh_stars>0
num =10086
| num =10086 | none | 1 | 1.072404 | 1 | |
tests/providers/dropbox/fixtures.py | KakeruMizuno/RDM-waterbutler | 0 | 6627592 | <filename>tests/providers/dropbox/fixtures.py
import io
import os
import json
import pytest
from waterbutler.core import streams
from waterbutler.providers.dropbox import DropboxProvider
@pytest.fixture
def auth():
return {'name': 'cat', 'email': '<EMAIL>'}
@pytest.fixture
def credentials():
return {'toke... | <filename>tests/providers/dropbox/fixtures.py
import io
import os
import json
import pytest
from waterbutler.core import streams
from waterbutler.providers.dropbox import DropboxProvider
@pytest.fixture
def auth():
return {'name': 'cat', 'email': '<EMAIL>'}
@pytest.fixture
def credentials():
return {'toke... | en | 0.584845 | # fixtures for testing validate_v1_path for root provider | 2.090881 | 2 |
salt/utils/path.py | veym4os/salt | 0 | 6627593 | <reponame>veym4os/salt
# -*- coding: utf-8 -*-
'''
Platform independent versions of some os/os.path functions. Gets around PY2's
lack of support for reading NTFS links.
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
try:
from collections.abc import Iterable
except... | # -*- coding: utf-8 -*-
'''
Platform independent versions of some os/os.path functions. Gets around PY2's
lack of support for reading NTFS links.
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
try:
from collections.abc import Iterable
except ImportError:
from ... | en | 0.795688 | # -*- coding: utf-8 -*- Platform independent versions of some os/os.path functions. Gets around PY2's lack of support for reading NTFS links. # Import python libs # Import Salt libs # Import 3rd-party libs Equivalent to os.path.islink() # check that it is a symlink reparse point (in case it is something else, # like a ... | 2.359116 | 2 |
Rabin_miller_primality_test.py | lokeshh/Information_security_lab | 7 | 6627594 | <reponame>lokeshh/Information_security_lab
import random
#Algorithm
#It returns false if n is composite and true if n is probably prime. K is an input parameter that determines accuracy level.
#Higher valur of k indicates more accuracy.
#miller test algo
def millertest(d,n):
#pick random no. in [2...n-2] and make s... | import random
#Algorithm
#It returns false if n is composite and true if n is probably prime. K is an input parameter that determines accuracy level.
#Higher valur of k indicates more accuracy.
#miller test algo
def millertest(d,n):
#pick random no. in [2...n-2] and make sure its >4
a = 2 + random.randint(1,1000... | en | 0.748302 | #Algorithm #It returns false if n is composite and true if n is probably prime. K is an input parameter that determines accuracy level. #Higher valur of k indicates more accuracy. #miller test algo #pick random no. in [2...n-2] and make sure its >4 #Compute a^d % n #checking if prime #corner cases # Find r such that n ... | 3.922358 | 4 |
example/test_ordinal_class_mark.py | DevilXD/pytest-order | 41 | 6627595 | <reponame>DevilXD/pytest-order
import pytest
@pytest.mark.order(1)
class Test1:
def test_1(self):
assert True
def test_2(self):
assert True
@pytest.mark.order(0)
class Test2:
def test_1(self):
assert True
def test_2(self):
assert True
| import pytest
@pytest.mark.order(1)
class Test1:
def test_1(self):
assert True
def test_2(self):
assert True
@pytest.mark.order(0)
class Test2:
def test_1(self):
assert True
def test_2(self):
assert True | none | 1 | 2.453094 | 2 | |
python/yb/release_util.py | def-/yugabyte-db | 0 | 6627596 | """
Copyright (c) Yugabyte, Inc.
This module provides utilities for generating and publishing release.
"""
import glob
import json
import logging
import os
import platform
import shutil
import sys
import re
import distro # type: ignore
from subprocess import call, check_output
from xml.dom import minidom
from yb.co... | """
Copyright (c) Yugabyte, Inc.
This module provides utilities for generating and publishing release.
"""
import glob
import json
import logging
import os
import platform
import shutil
import sys
import re
import distro # type: ignore
from subprocess import call, check_output
from xml.dom import minidom
from yb.co... | en | 0.87086 | Copyright (c) Yugabyte, Inc. This module provides utilities for generating and publishing release. # type: ignore Packages a YugaByte package with the appropriate file naming schema. :param repository: the path to YugabyteDB repository (also known as YB_SRC_ROOT). :param build_type: build type such as "release... | 2.321387 | 2 |
redash/handlers/data_sources.py | ivanli1990/redash | 1 | 6627597 | <reponame>ivanli1990/redash
import logging
from flask import make_response, request
from flask_restful import abort
from funcy import project
from six import text_type
from sqlalchemy.exc import IntegrityError
from redash import models
from redash.handlers.base import BaseResource, get_object_or_404, require_fields
f... | import logging
from flask import make_response, request
from flask_restful import abort
from funcy import project
from six import text_type
from sqlalchemy.exc import IntegrityError
from redash import models
from redash.handlers.base import BaseResource, get_object_or_404, require_fields
from redash.permissions impor... | en | 0.353307 | #to_dict (data source id: %d)", ds.id) # from IPython import embed # embed() | 1.835318 | 2 |
NACA.py | ciaid-colombia/airfoil | 0 | 6627598 | <filename>NACA.py
##http://airfoiltools.com/airfoil/naca4digit
from dolfin import *
import ufl
import time
import os
import mshr
# get file name
fileName = os.path.splitext(__file__)[0]
parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["quadrature_degree"] = 8
#parameters["form_compiler"... | <filename>NACA.py
##http://airfoiltools.com/airfoil/naca4digit
from dolfin import *
import ufl
import time
import os
import mshr
# get file name
fileName = os.path.splitext(__file__)[0]
parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["quadrature_degree"] = 8
#parameters["form_compiler"... | en | 0.363331 | ##http://airfoiltools.com/airfoil/naca4digit # get file name #parameters["form_compiler"]["quadrature_rule"] = 'auto' # Time stepping parameters # theta schema ## Create mesh # Create list of polygonal domain vertices for the car # Define function spaces # Define unknown and test function(s) # Identity tensor #ffc_opti... | 2.054391 | 2 |
mopidy_tidal/__init__.py | mones88/mopidy-tidal | 30 | 6627599 | from __future__ import unicode_literals
import logging
import os
import sys
from mopidy import config, ext
__version__ = '0.2.7'
# TODO: If you need to log, use loggers named after the current Python module
logger = logging.getLogger(__name__)
file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)
class ... | from __future__ import unicode_literals
import logging
import os
import sys
from mopidy import config, ext
__version__ = '0.2.7'
# TODO: If you need to log, use loggers named after the current Python module
logger = logging.getLogger(__name__)
file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)
class ... | en | 0.689266 | # TODO: If you need to log, use loggers named after the current Python module | 2.128798 | 2 |
dvc/fs/git.py | PietrassykFP/dvc | 1 | 6627600 | import os
import threading
from typing import TYPE_CHECKING, Any, Callable
from funcy import cached_property, wrap_prop
from .fsspec_wrapper import AnyFSPath, FSSpecWrapper
if TYPE_CHECKING:
from scmrepo.fs import GitFileSystem as FsspecGitFileSystem
from scmrepo.git import Git
from scmrepo.git.objects i... | import os
import threading
from typing import TYPE_CHECKING, Any, Callable
from funcy import cached_property, wrap_prop
from .fsspec_wrapper import AnyFSPath, FSSpecWrapper
if TYPE_CHECKING:
from scmrepo.fs import GitFileSystem as FsspecGitFileSystem
from scmrepo.git import Git
from scmrepo.git.objects i... | en | 0.663718 | # pylint:disable=abstract-method Proxies the repo file access methods to Git objects | 2.163122 | 2 |
python/baseline/model.py | domyounglee/baseline | 0 | 6627601 | <filename>python/baseline/model.py
import logging
import numpy as np
from baseline.utils import (
export, optional_params, listify, register, import_user_module, read_json
)
__all__ = []
exporter = export(__all__)
logger = logging.getLogger('baseline')
BASELINE_MODELS = {}
BASELINE_LOADERS = {}
@exporter
@optio... | <filename>python/baseline/model.py
import logging
import numpy as np
from baseline.utils import (
export, optional_params, listify, register, import_user_module, read_json
)
__all__ = []
exporter = export(__all__)
logger = logging.getLogger('baseline')
BASELINE_MODELS = {}
BASELINE_LOADERS = {}
@exporter
@optio... | en | 0.859204 | Register a function as a plug-in Register a function as a plug-in Register a function as a plug-in Register a function as a plug-in # Sniff state to see if we need to import things # There won't be a module for pytorch (there is no state file to load). # Allow user to override model type (for back compat with old api),... | 2.215983 | 2 |
-Loan-Approval-Analysis-/code.py | amrapali10/ga-learner-dsmp-repo | 0 | 6627602 | <reponame>amrapali10/ga-learner-dsmp-repo
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
df = pd.read_csv(path)
bank = pd.DataFrame(df)
categorical_var = df.select_dtypes(include = 'object')
print(categorical_var)
print('='*50)
numerical_v... | # --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
df = pd.read_csv(path)
bank = pd.DataFrame(df)
categorical_var = df.select_dtypes(include = 'object')
print(categorical_var)
print('='*50)
numerical_var = df.select_dtypes(include = 'number')
... | en | 0.540579 | # -------------- # Import packages # code starts here # code ends here # -------------- # code starts here #print(bank_mode) #banks = banks.fillna(banks.mode()) #code ends here # -------------- # Code starts here # code ends here # -------------- # code starts here # code ends here # -------------- # code starts here #... | 3.031501 | 3 |
Labs/Lab07/src/laplacian.py | ethank5149/PurduePHYS580 | 0 | 6627603 | <reponame>ethank5149/PurduePHYS580
from numba import jit
import numpy as np
@jit
def laplacian_1d(n):
return np.diag(2 * np.ones(n - 2)) + \
np.diag(-np.ones(n - 3), 1) + \
np.diag(-np.ones(n - 3), -1)
@jit
def laplacian_2d(n):
return np.kron(np.eye(n - 2), laplacian_1d(n)) ... | from numba import jit
import numpy as np
@jit
def laplacian_1d(n):
return np.diag(2 * np.ones(n - 2)) + \
np.diag(-np.ones(n - 3), 1) + \
np.diag(-np.ones(n - 3), -1)
@jit
def laplacian_2d(n):
return np.kron(np.eye(n - 2), laplacian_1d(n)) + \
np.kron(laplacian_1d... | en | 0.204216 | # from scipy.sparse import diags, kron, eye # @jit # def laplacian_1d(n): # return diags([2 * np.ones(n - 2), -np.ones(n - 3), -np.ones(n - 3)], [0, 1, -1]) # @jit # def laplacian_2d(n): # return kron(eye(n - 2), laplacian_1d(n)) + \ # kron(laplacian_1d(n), eye(n - 2)) | 2.711412 | 3 |
YOLOv1/model.py | aryaman4152/model-implementations-PyTorch | 1 | 6627604 | <gh_stars>1-10
import torch
import torch.nn as nn
class Convolution(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding, stride):
super(Convolution, self).__init__()
self.conv = nn.Conv2d(in_channels=in_channels,
out_channels=out_channels,
... | import torch
import torch.nn as nn
class Convolution(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, padding, stride):
super(Convolution, self).__init__()
self.conv = nn.Conv2d(in_channels=in_channels,
out_channels=out_channels,
... | en | 0.651285 | # Section 1 # Tried all paddings from 0, 3 gives correct output shape # Section 2 #not strided conv # Section 3 # section 4 # section 5 # section 6 # fc section # reshape output | 2.808194 | 3 |
scripts/min_max.py | BLZ11/data_stats | 0 | 6627605 | <reponame>BLZ11/data_stats<gh_stars>0
"""Fake module that supposedly computes the minimum and maximum values of dependent variable y"""
import numpy as np
def min_max(y_data):
"""Calculate the second-to-last mininum and second-to-last maximum valuse of dependent variable y"""
sort_data = np.sort(y_data)
... | """Fake module that supposedly computes the minimum and maximum values of dependent variable y"""
import numpy as np
def min_max(y_data):
"""Calculate the second-to-last mininum and second-to-last maximum valuse of dependent variable y"""
sort_data = np.sort(y_data)
minimum = sort_data[1] # secon... | en | 0.687555 | Fake module that supposedly computes the minimum and maximum values of dependent variable y Calculate the second-to-last mininum and second-to-last maximum valuse of dependent variable y # second-to-last mininum value # second-to-last maximum value | 3.431555 | 3 |
CTFd/utils/email/__init__.py | AIica/Crypto-2020 | 0 | 6627606 | <reponame>AIica/Crypto-2020
from flask import current_app as app, url_for
from CTFd.utils import get_config, get_app_config
from CTFd.utils.config import get_mail_provider, mailserver
from CTFd.utils.encoding import base64decode, base64encode
from CTFd.utils.email import mailgun, smtp
from itsdangerous import TimedSeri... | from flask import current_app as app, url_for
from CTFd.utils import get_config, get_app_config
from CTFd.utils.config import get_mail_provider, mailserver
from CTFd.utils.encoding import base64decode, base64encode
from CTFd.utils.email import mailgun, smtp
from itsdangerous import TimedSerializer, BadTimeSignature, Si... | en | 0.829658 | Did you initiate a password reset? Click the following link to reset your password: {0}/{1} Please click the following link to confirm your email address for {ctf_name}: {url}/{token} | 2.428565 | 2 |
_unittests/ut_filehelper/test_winzipfile.py | Pandinosaurus/pyquickhelper | 18 | 6627607 | """
@brief test log(time=2s)
@author <NAME>
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.filehelper.winzipfile import WinZipFile
class TestWinZipFile(unittest.TestCase):
def test_winzipfile(self):
fLOG(
__file__,
s... | """
@brief test log(time=2s)
@author <NAME>
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.filehelper.winzipfile import WinZipFile
class TestWinZipFile(unittest.TestCase):
def test_winzipfile(self):
fLOG(
__file__,
s... | en | 0.312813 | @brief test log(time=2s) @author <NAME> | 2.737492 | 3 |
firebase/fcm.py | BraydenKO/RamLife | 3 | 6627608 | <filename>firebase/fcm.py
from firebase_admin import initialize_app, credentials, messaging as FCM
print ("Initializing...")
initialize_app (credentials.Certificate(path))
def get_message(command, topic): return FCM.Message(
data = {
"command": command,
"collapseKey": topic,
"click_action": "FLUTTER_NOTIFICATI... | <filename>firebase/fcm.py
from firebase_admin import initialize_app, credentials, messaging as FCM
print ("Initializing...")
initialize_app (credentials.Certificate(path))
def get_message(command, topic): return FCM.Message(
data = {
"command": command,
"collapseKey": topic,
"click_action": "FLUTTER_NOTIFICATI... | none | 1 | 2.42345 | 2 | |
pyseqlab/hosemi_crf_ad.py | bratao/-PySeqLab | 6 | 6627609 | """
@author: <NAME> <<EMAIL>>
"""
import numpy
from .linear_chain_crf import LCRFModelRepresentation, LCRF
from .utilities import (
HOSemi_AStarSearcher,
vectorized_logsumexp,
generate_partitions,
generate_partition_boundaries,
)
class HOSemiCRFADModelRepresentation(LCRFModelRepresentation):
r"""... | """
@author: <NAME> <<EMAIL>>
"""
import numpy
from .linear_chain_crf import LCRFModelRepresentation, LCRF
from .utilities import (
HOSemi_AStarSearcher,
vectorized_logsumexp,
generate_partitions,
generate_partition_boundaries,
)
class HOSemiCRFADModelRepresentation(LCRFModelRepresentation):
r"""... | en | 0.716332 | @author: <NAME> <<EMAIL>> Model representation that will hold data structures to be used in :class:`HOSemiCRF` class Attributes: P_codebook: set of proper prefixes of the elements in the set of patterns :attr:`Z_codebook` e.g. {'':0, 'P':1, 'L':2, 'O':3, 'L|O':4, ...} ... | 2.36781 | 2 |
examples/example_logical.py | Xamber/Bhaalgorn | 0 | 6627610 | import numpy as np
from regression import LogisticRegression
np.random.seed(123)
training_set_logic = np.array([
[0.5, 1.0, 1],
[0.5, 0.6, 1],
[0.6, 0.5, 1],
[1.0, 1.0, 1],
[0.1, 0.1, 0],
[0.1, 0.3, 0],
[0.2, 0.1, 0],
[0.0, 0.0, 0],
[0.4, 0.4, 0],
])
logical = LogisticRegression(t... | import numpy as np
from regression import LogisticRegression
np.random.seed(123)
training_set_logic = np.array([
[0.5, 1.0, 1],
[0.5, 0.6, 1],
[0.6, 0.5, 1],
[1.0, 1.0, 1],
[0.1, 0.1, 0],
[0.1, 0.3, 0],
[0.2, 0.1, 0],
[0.0, 0.0, 0],
[0.4, 0.4, 0],
])
logical = LogisticRegression(t... | none | 1 | 2.94126 | 3 | |
gsw/gibbs/isobaric.py | ocefpaf/python-gsw | 35 | 6627611 | <reponame>ocefpaf/python-gsw
# -*- coding: utf-8 -*-
from __future__ import division
from .conversions import CT_from_pt
from ..utilities import match_args_return
__all__ = ['latentheat_evap_t']
# 'latentheat_evap_CT',
# 'latentheat_melting',
#@match_args_return
#def latentheat_evap_CT(SA, CT)... | # -*- coding: utf-8 -*-
from __future__ import division
from .conversions import CT_from_pt
from ..utilities import match_args_return
__all__ = ['latentheat_evap_t']
# 'latentheat_evap_CT',
# 'latentheat_melting',
#@match_args_return
#def latentheat_evap_CT(SA, CT):
# pass
#@match_args_re... | en | 0.537204 | # -*- coding: utf-8 -*- # 'latentheat_evap_CT', # 'latentheat_melting', #@match_args_return #def latentheat_evap_CT(SA, CT): # pass #@match_args_return #def latentheat_melting(SA, p): # pass Calculates latent heat, or enthalpy, of evaporation at p = 0 (the surface). It is defined as a fun... | 2.432606 | 2 |
genart/tf/morph/model.py | dyf/genart | 0 | 6627612 | <reponame>dyf/genart
import tensorflow as tf
from tensorflow.keras.layers import LSTM, GRU, Dense, Bidirectional, Input, RepeatVector, TimeDistributed, Dropout
from tensorflow.keras.models import Sequential
from tensorflow.keras import Model
def MorphModel(input_shape):
return Sequential([
GRU(512, ... | import tensorflow as tf
from tensorflow.keras.layers import LSTM, GRU, Dense, Bidirectional, Input, RepeatVector, TimeDistributed, Dropout
from tensorflow.keras.models import Sequential
from tensorflow.keras import Model
def MorphModel(input_shape):
return Sequential([
GRU(512, activation='relu', in... | none | 1 | 2.736704 | 3 | |
tests/test_template.py | beproud/bpcommons | 2 | 6627613 | <reponame>beproud/bpcommons
#:coding=utf-8:
from __future__ import print_function
from django import VERSION as DJANGO_VERSION
from django.test import TestCase as DjangoTestCase
from django.template import TemplateSyntaxError
try:
from django.template import (
Lexer,
Parser,
)
except ImportErro... | #:coding=utf-8:
from __future__ import print_function
from django import VERSION as DJANGO_VERSION
from django.test import TestCase as DjangoTestCase
from django.template import TemplateSyntaxError
try:
from django.template import (
Lexer,
Parser,
)
except ImportError:
from django.template.... | en | 0.582123 | #:coding=utf-8: # :( # DJANGO_VERSION > (1,7): | 2.128067 | 2 |
start_og.py | chan2565/obd_gui | 0 | 6627614 | <gh_stars>0
import obd
from obd_gui import (
window,
new_speed,
new_rpm,
new_coolant_temp,
new_engine_load,
new_intake_temp,
new_throttle_pos,
new_timing_adv,
conn_lbl,
)
try:
# Start async connection to OBD adapter
# connection = obd.Async(baudrate=9600)
connection = o... | import obd
from obd_gui import (
window,
new_speed,
new_rpm,
new_coolant_temp,
new_engine_load,
new_intake_temp,
new_throttle_pos,
new_timing_adv,
conn_lbl,
)
try:
# Start async connection to OBD adapter
# connection = obd.Async(baudrate=9600)
connection = obd.Async()
... | en | 0.548562 | # Start async connection to OBD adapter # connection = obd.Async(baudrate=9600) # Set up codes to watch with callbacks # connection.watch(obd.commands.ELM_VOLTAGE, callback=new_obd_voltage) # connection.watch(obd.commands.FUEL_STATUS, callback=new_fuel_status) # Start monitoring # Start display | 2.440167 | 2 |
deep-learning-for-image-processing-master/pytorch_object_detection/ssd/train_ssd300.py | zpwithme/zzzzpppp | 0 | 6627615 | <reponame>zpwithme/zzzzpppp
import os
import datetime
import torch
import transforms
from my_dataset import VOC2012DataSet
from src import SSD300, Backbone
import train_utils.train_eval_utils as utils
from train_utils import get_coco_api_from_dataset
def create_model(num_classes=21, device=torch.device('cpu')):
... | import os
import datetime
import torch
import transforms
from my_dataset import VOC2012DataSet
from src import SSD300, Backbone
import train_utils.train_eval_utils as utils
from train_utils import get_coco_api_from_dataset
def create_model(num_classes=21, device=torch.device('cpu')):
# https://download.pytorch.... | zh | 0.464735 | # https://download.pytorch.org/models/resnet50-19c8e357.pth # pre_train_path = "./src/resnet50.pth" # https://ngc.nvidia.com/catalog/models -> search ssd -> download FP32 # 删除类别预测器权重,注意,回归预测器的权重可以重用,因为不涉及num_classes # check voc root # 注意训练时,batch_size必须大于1 # 防止最后一个batch_size=1,如果最后一个batch_size=1就舍去 # number of workers ... | 2.445689 | 2 |
shop/admin/mixins.py | dwx9/test | 1 | 6627616 | <filename>shop/admin/mixins.py<gh_stars>1-10
#-*- coding: utf-8 -*-
from django import forms
class LocalizeDecimalFieldsForm(forms.ModelForm):
def __new__(cls, *args, **kwargs):
new_class = super(LocalizeDecimalFieldsForm, cls).__new__(cls)
if hasattr(new_class, 'base_fields'):
for fie... | <filename>shop/admin/mixins.py<gh_stars>1-10
#-*- coding: utf-8 -*-
from django import forms
class LocalizeDecimalFieldsForm(forms.ModelForm):
def __new__(cls, *args, **kwargs):
new_class = super(LocalizeDecimalFieldsForm, cls).__new__(cls)
if hasattr(new_class, 'base_fields'):
for fie... | en | 0.886119 | #-*- coding: utf-8 -*- To be used as a mixin for classes derived from admin.ModelAdmin, admin.TabularInline, etc. which localizes the input fields for models of type DecimalField in the admin interface. If your class derived from ModelAdmin wants to override the form attribute, make sure that this form ... | 2.039436 | 2 |
dbutil/dbutil.py | Dannywanxyz/aladin | 0 | 6627617 | <gh_stars>0
#!/usr/bin/env python
#encoding:utf8
import json
import time,random
import datetime
import MySQLdb
import MySQLdb.cursors
class DB:
conn = None
db = None
host = None
def __init__(self, host, mysql_user, mysql_pass, mysql_db):
self.host = host
self.mysql_user = mysql_user
... | #!/usr/bin/env python
#encoding:utf8
import json
import time,random
import datetime
import MySQLdb
import MySQLdb.cursors
class DB:
conn = None
db = None
host = None
def __init__(self, host, mysql_user, mysql_pass, mysql_db):
self.host = host
self.mysql_user = mysql_user
self.... | en | 0.137559 | #!/usr/bin/env python #encoding:utf8 | 2.946452 | 3 |
BFRB_Detection_Data/pipeline/1-_WindowSplit.py | Bhorda/BFRBAnticipationDataset | 3 | 6627618 | <reponame>Bhorda/BFRBAnticipationDataset
import numpy as np
import pandas as ps
import math
import sys
import random
### Negative windows
# prediction window and labeled window length in seconds
directory = sys.argv[1]
xSize = int(sys.argv[2]) # xwindow size
ySize = int(sys.argv[3]) # ywindow size
uID = sys.argv[4] #... | import numpy as np
import pandas as ps
import math
import sys
import random
### Negative windows
# prediction window and labeled window length in seconds
directory = sys.argv[1]
xSize = int(sys.argv[2]) # xwindow size
ySize = int(sys.argv[3]) # ywindow size
uID = sys.argv[4] # participant ID
norm = sys.argv[5] # norm... | en | 0.370915 | ### Negative windows # prediction window and labeled window length in seconds # xwindow size # ywindow size # participant ID # normalisation type: zscore/minmax # ppg processed separately # print(mark) # print('during behaviour period ' + str(wIndex) + ' ') # print('behaviour overlap ' + str(wIndex) + ' ' + str(j[1])) ... | 2.314624 | 2 |
tests/test_load_stage.py | kids-first/kf-lib-data-ingest | 3 | 6627619 | <reponame>kids-first/kf-lib-data-ingest
import os
import pytest
from click.testing import CliRunner
from pandas import DataFrame
from conftest import KIDS_FIRST_CONFIG, TEST_INGEST_CONFIG
from kf_lib_data_ingest.app import cli
from kf_lib_data_ingest.common.errors import InvalidIngestStageParameters
from kf_lib_data_... | import os
import pytest
from click.testing import CliRunner
from pandas import DataFrame
from conftest import KIDS_FIRST_CONFIG, TEST_INGEST_CONFIG
from kf_lib_data_ingest.app import cli
from kf_lib_data_ingest.common.errors import InvalidIngestStageParameters
from kf_lib_data_ingest.etl.configuration.base_config imp... | en | 0.65664 | Test running transform with invalid run params Test that async loading exits when threads raise exceptions Test input validation | 1.986447 | 2 |
src/3rdparty/torrent-rasterbar/bindings/python/test.py | adem4ik/LIII | 664 | 6627620 | #!/usr/bin/env python
import libtorrent as lt
import unittest
import time
import os
import shutil
import binascii
import inspect
import pickle
class test_create_torrent(unittest.TestCase):
def test_from_torrent_info(self):
ti = lt.torrent_info('unordered.torrent')
ct = lt.create_torrent(ti, True)
entry = ct.... | #!/usr/bin/env python
import libtorrent as lt
import unittest
import time
import os
import shutil
import binascii
import inspect
import pickle
class test_create_torrent(unittest.TestCase):
def test_from_torrent_info(self):
ti = lt.torrent_info('unordered.torrent')
ct = lt.create_torrent(ti, True)
entry = ct.... | en | 0.860912 | #!/usr/bin/env python # also test the overload that takes a list of piece->priority mappings # get another instance of a torrent_handle that represents the same # torrent. Make sure that when we add it to a set, it just replaces the # existing object # get another instance of a torrent_handle that represents the same #... | 2.364894 | 2 |
scripts/gen_operator_csv.py | staebler/osd-operators-registry | 4 | 6627621 | <filename>scripts/gen_operator_csv.py
#!/usr/bin/env python
#
# Generate an operator bundle for publishing to OLM. Copies appropriate files
# into a directory, and composes the ClusterServiceVersion which needs bits and
# pieces of our rbac and deployment files.
#
import datetime
import os
import sys
import yaml
impor... | <filename>scripts/gen_operator_csv.py
#!/usr/bin/env python
#
# Generate an operator bundle for publishing to OLM. Copies appropriate files
# into a directory, and composes the ClusterServiceVersion which needs bits and
# pieces of our rbac and deployment files.
#
import datetime
import os
import sys
import yaml
impor... | en | 0.831335 | #!/usr/bin/env python # # Generate an operator bundle for publishing to OLM. Copies appropriate files # into a directory, and composes the ClusterServiceVersion which needs bits and # pieces of our rbac and deployment files. # # Coerce to a boolean # Check to see if the manifests directory exists before going on. # fai... | 2.201246 | 2 |
recode/__init__.py | otosense/recode | 0 | 6627622 | r"""
Make codecs for fixed size structured chunks serialization and deserialization of
sequences, tabular data, and time-series.
The easiest and bigest bang for your buck is ``mk_codec``
>>> from recode import mk_codec
>>> encoder, decoder = mk_codec()
``encoder`` will encode a list (or any iterable) of numbers into... | r"""
Make codecs for fixed size structured chunks serialization and deserialization of
sequences, tabular data, and time-series.
The easiest and bigest bang for your buck is ``mk_codec``
>>> from recode import mk_codec
>>> encoder, decoder = mk_codec()
``encoder`` will encode a list (or any iterable) of numbers into... | en | 0.825712 | Make codecs for fixed size structured chunks serialization and deserialization of sequences, tabular data, and time-series. The easiest and bigest bang for your buck is ``mk_codec`` >>> from recode import mk_codec >>> encoder, decoder = mk_codec() ``encoder`` will encode a list (or any iterable) of numbers into byte... | 3.188974 | 3 |
bioblend/galaxy/datasets/__init__.py | davidchristiany/bioblend | 0 | 6627623 | <reponame>davidchristiany/bioblend
"""
Contains possible interactions with the Galaxy Datasets
"""
import logging
import os
import shlex
import time
from six.moves.urllib.parse import urljoin
from six.moves.urllib.request import urlopen
import bioblend
from bioblend.galaxy.client import Client
log = logging.getLogge... | """
Contains possible interactions with the Galaxy Datasets
"""
import logging
import os
import shlex
import time
from six.moves.urllib.parse import urljoin
from six.moves.urllib.request import urlopen
import bioblend
from bioblend.galaxy.client import Client
log = logging.getLogger(__name__)
terminal_states = ('ok... | en | 0.699391 | Contains possible interactions with the Galaxy Datasets Get details about a given dataset. This can be a history or a library dataset. :type dataset_id: str :param dataset_id: Encoded dataset ID :type deleted: bool :param deleted: Whether to return results for a deleted dataset ... | 2.646211 | 3 |
src/foolscap/copyable.py | jaraco/foolscap | 29 | 6627624 | # -*- test-case-name: foolscap.test.test_copyable -*-
# this module is responsible for all copy-by-value objects
import six
from zope.interface import interface, implementer
from twisted.python import reflect, log
from twisted.python.components import registerAdapter
from twisted.internet import defer
from . import s... | # -*- test-case-name: foolscap.test.test_copyable -*-
# this module is responsible for all copy-by-value objects
import six
from zope.interface import interface, implementer
from twisted.python import reflect, log
from twisted.python.components import registerAdapter
from twisted.internet import defer
from . import s... | en | 0.87542 | # -*- test-case-name: foolscap.test.test_copyable -*- # this module is responsible for all copy-by-value objects ############################################################ # the first half of this file is sending/serialization I represent an object which is passed-by-value across PB connections. Return a string which... | 1.944322 | 2 |
divmachines/logging.py | DanielMorales9/FactorizationPyTorch | 4 | 6627625 | <filename>divmachines/logging.py
class Logger(object):
"""
Base class for logging.
"""
def __init__(self):
pass
def log(self, *args, **kwargs):
pass
def flush(self):
"""
Cancels all logs
"""
pass
class TrainingLogger(Logger):
"""
Train... | <filename>divmachines/logging.py
class Logger(object):
"""
Base class for logging.
"""
def __init__(self):
pass
def log(self, *args, **kwargs):
pass
def flush(self):
"""
Cancels all logs
"""
pass
class TrainingLogger(Logger):
"""
Train... | en | 0.700204 | Base class for logging. Cancels all logs Training Logger a class that logs the training process. It can be configured for storing the losses for each epoch and for each batch. Parameters ---------- batch: bool, optional Flag for logging batch or not Getter for the losses :return: li... | 3.197384 | 3 |
uaa-python/app/web/rest/article_api.py | suomitek/cubeai | 0 | 6627626 | import json
import tornado.web
from app.domain.article import Article
from app.service import token_service
from app.database import article_db
from app.utils import mytime
class ArticleApiA(tornado.web.RequestHandler):
async def post(self, *args, **kwargs):
token = token_service.get_token(self.request)
... | import json
import tornado.web
from app.domain.article import Article
from app.service import token_service
from app.database import article_db
from app.utils import mytime
class ArticleApiA(tornado.web.RequestHandler):
async def post(self, *args, **kwargs):
token = token_service.get_token(self.request)
... | none | 1 | 2.104583 | 2 | |
pyrival/geometry/lines.py | tusshar2000/PyRival | 1 | 6627627 | <gh_stars>1-10
import itertools
import math
# 2d line: ax + by + c = 0 is (a, b, c)
# ax + by + c = 0 ((a, b, c),
# 3d line: dx + ez + f = 0 is (d, e, f),
# gy + hz + i = 0 (g, h, i))
def gcd(x, y):
"""greatest common divisor of x and y"""
while y:
x, y = y, x % y
... | import itertools
import math
# 2d line: ax + by + c = 0 is (a, b, c)
# ax + by + c = 0 ((a, b, c),
# 3d line: dx + ez + f = 0 is (d, e, f),
# gy + hz + i = 0 (g, h, i))
def gcd(x, y):
"""greatest common divisor of x and y"""
while y:
x, y = y, x % y
return x
def... | en | 0.890085 | # 2d line: ax + by + c = 0 is (a, b, c) # ax + by + c = 0 ((a, b, c), # 3d line: dx + ez + f = 0 is (d, e, f), # gy + hz + i = 0 (g, h, i)) greatest common divisor of x and y | 3.479377 | 3 |
monasca_common/rest/utils.py | zhangjianweibj/monasca-common | 0 | 6627628 | # Copyright 2015 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright 2015 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | en | 0.802362 | # Copyright 2015 FUJITSU LIMITED # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ... | 1.870754 | 2 |
src/labeling/common.py | ZendriXXX/CMF | 0 | 6627629 | from enum import Enum
class LabelTypes(Enum):
NEXT_ACTIVITY = 'next_activity'
ATTRIBUTE_STRING = 'label_attribute_string'
def add_label_column(trace, labeling_type, prefix_length: int):
"""TODO COMMENT ME
"""
if labeling_type == LabelTypes.NEXT_ACTIVITY.value:
return next_event_name(trac... | from enum import Enum
class LabelTypes(Enum):
NEXT_ACTIVITY = 'next_activity'
ATTRIBUTE_STRING = 'label_attribute_string'
def add_label_column(trace, labeling_type, prefix_length: int):
"""TODO COMMENT ME
"""
if labeling_type == LabelTypes.NEXT_ACTIVITY.value:
return next_event_name(trac... | en | 0.466859 | TODO COMMENT ME Return the event event_name at prefix length or 0 if out of range. | 3.046031 | 3 |
src/tests/test_with_function.py | sjsumitj/pytest_tutorial | 1 | 6627630 | import pytest
from ..sum import *
#make sure to start function name with test
def test_sum():
assert sum(1, 2) == 3 | import pytest
from ..sum import *
#make sure to start function name with test
def test_sum():
assert sum(1, 2) == 3 | en | 0.877947 | #make sure to start function name with test | 2.553595 | 3 |
src/sadie/typing/species.py | jwillis0720/pybody | 0 | 6627631 | from collections import UserString
from typing import Callable, Generator
from pydantic.fields import ModelField
# TODO: go through and see which are viable to use; tests need to be fixed first in test_g3 to handle this
SPECIES = {
"rhesus": "macaque",
"homo_sapiens": "human",
"mus": "mouse",
"rattus_... | from collections import UserString
from typing import Callable, Generator
from pydantic.fields import ModelField
# TODO: go through and see which are viable to use; tests need to be fixed first in test_g3 to handle this
SPECIES = {
"rhesus": "macaque",
"homo_sapiens": "human",
"mus": "mouse",
"rattus_... | en | 0.130891 | # TODO: go through and see which are viable to use; tests need to be fixed first in test_g3 to handle this # 'amberjack': 'amberjack', # 'bass': 'bass', # 'boar': 'boar', # 'bull_shark': 'bull_shark', # 'camel': 'camel', # 'carp': 'carp', # 'catfish': 'catfish', # 'char': 'char', # 'chinese_perch': 'chinese_perch', # '... | 2.589187 | 3 |
node_map.py | couchbase/healthchecker | 2 | 6627632 | address_map = {
"10.12.87.41" : "2172.16.58.33",
"10.12.95.171" : "192.168.3.11",
"10.194.169.187" : "192.168.127.12",
"10.12.98.26" : "23.20.50.242",
"10.144.64.38" : "192.168.3.11",
"10.12.97.189" : "172.16.58.3",
}
| address_map = {
"10.12.87.41" : "2172.16.58.33",
"10.12.95.171" : "192.168.3.11",
"10.194.169.187" : "192.168.127.12",
"10.12.98.26" : "23.20.50.242",
"10.144.64.38" : "192.168.3.11",
"10.12.97.189" : "172.16.58.3",
}
| none | 1 | 1.563335 | 2 | |
src/spaceone/inventory/manager/__init__.py | jean1042/plugin-aws-cloud-services | 2 | 6627633 | from spaceone.inventory.manager.cloudfront_manager import CloudFrontConnectorManager
from spaceone.inventory.manager.lambda_manager import LambdaConnectorManager
from spaceone.inventory.manager.rds_manager import RDSConnectorManager
from spaceone.inventory.manager.api_gateway_manager import APIGatewayConnectorManager
f... | from spaceone.inventory.manager.cloudfront_manager import CloudFrontConnectorManager
from spaceone.inventory.manager.lambda_manager import LambdaConnectorManager
from spaceone.inventory.manager.rds_manager import RDSConnectorManager
from spaceone.inventory.manager.api_gateway_manager import APIGatewayConnectorManager
f... | en | 0.393256 | # from spaceone.inventory.manager.workspace_manager import WorkspaceCollectorManager | 1.026564 | 1 |
paystacklib/api/charge.py | abimbola/paystack-lib-python | 0 | 6627634 | import paystacklib
from paystacklib.base.baseapi import BaseApi
from paystacklib.util.utils import clean_params
class Charge(BaseApi):
object_type = '/charge'
def __init__(
self, secret_key=None,
uri=paystacklib.api_base + object_type, method=None,
headers=None, params=None... | import paystacklib
from paystacklib.base.baseapi import BaseApi
from paystacklib.util.utils import clean_params
class Charge(BaseApi):
object_type = '/charge'
def __init__(
self, secret_key=None,
uri=paystacklib.api_base + object_type, method=None,
headers=None, params=None... | none | 1 | 2.219899 | 2 | |
test/utility/genome_size_tests.py | samseaver/GenomeFileUtil | 0 | 6627635 | <filename>test/utility/genome_size_tests.py
import os
import shutil
import time
import unittest
import mock
from configparser import ConfigParser
from installed_clients.DataFileUtilClient import DataFileUtil
from GenomeFileUtil.GenomeFileUtilImpl import GenomeFileUtil
from GenomeFileUtil.GenomeFileUtilServer import Me... | <filename>test/utility/genome_size_tests.py
import os
import shutil
import time
import unittest
import mock
from configparser import ConfigParser
from installed_clients.DataFileUtilClient import DataFileUtil
from GenomeFileUtil.GenomeFileUtilImpl import GenomeFileUtil
from GenomeFileUtil.GenomeFileUtilServer import Me... | en | 0.970041 | # WARNING: don't call any logging methods on the context object, # it'll result in a NoneType error # features should not have sequences in it. But both non_coding_features and CDSs should have sequences. # features should not have sequences in it. But both non_coding_features and CDSs should have sequences. # features... | 2.099079 | 2 |
scripts/compare_models.py | milebril/Temporal-SBMC-extension | 0 | 6627636 | <reponame>milebril/Temporal-SBMC-extension
import numpy as np
import torch as th
import cv2
import argparse
import tempfile
from torch.utils.data import DataLoader
import os
import pyexr
import cv2
import skimage.io as skio
from ttools.modules.image_operators import crop_like
import matplotlib.pyplot as plt
from collec... | import numpy as np
import torch as th
import cv2
import argparse
import tempfile
from torch.utils.data import DataLoader
import os
import pyexr
import cv2
import skimage.io as skio
from ttools.modules.image_operators import crop_like
import matplotlib.pyplot as plt
from collections import defaultdict
from sbmc import ... | en | 0.746113 | #'ksize': 21, 'gather': False, 'pixel': False # Load the data # Load the two models # Depending on the way a model is saved, the statedict is referenced with different keys # Depending on the way a model is saved, the statedict is referenced with different keys # start = np.random.randint(0, 80) * 5 # Sets the tensors ... | 1.971375 | 2 |
app.py | arjundha/COMP1510-Hackathon | 0 | 6627637 | """
Main application file
"""
import market_data
import covid19_stats
import news
import user_generation
import funding
import dow_plot
import doctest
def option_menu() -> int:
"""
Ask user to choose option.
:precondition: input must be a number that corresponds with an option
:postcondition: will re... | """
Main application file
"""
import market_data
import covid19_stats
import news
import user_generation
import funding
import dow_plot
import doctest
def option_menu() -> int:
"""
Ask user to choose option.
:precondition: input must be a number that corresponds with an option
:postcondition: will re... | en | 0.715568 | Main application file Ask user to choose option. :precondition: input must be a number that corresponds with an option :postcondition: will return the user's choice as an int :return: input as an int 1. Global Statistics 2. Information about my Country 3. Search by Country 4. News Articles 5. ... | 3.844191 | 4 |
apps/osis/logic/system/disk/system_disk_osismodelbase.py | rudecs/jumpscale_core7 | 0 | 6627638 | <reponame>rudecs/jumpscale_core7
from JumpScale import j
class system_disk_osismodelbase(j.code.classGetJSRootModelBase()):
def __init__(self):
pass
self._P_id=0
self._P_partnr=0
self._P_gid=0
self._P_nid=0
self._P_path=""
self._P_size=0
self._P_free=... | from JumpScale import j
class system_disk_osismodelbase(j.code.classGetJSRootModelBase()):
def __init__(self):
pass
self._P_id=0
self._P_partnr=0
self._P_gid=0
self._P_nid=0
self._P_path=""
self._P_size=0
self._P_free=0
self._P_ssd=0
s... | en | 0.745183 | #@todo version not implemented now, just already foreseen | 2.052455 | 2 |
serpantin/apps/common/models.py | ainomugish/serpantin | 0 | 6627639 | <reponame>ainomugish/serpantin
#
#
#
from string import find
from django.db import models
#from django.core import validators
#from django.core.validators import isValidEmail
from django.utils.translation import gettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contentty... | #
#
#
from string import find
from django.db import models
#from django.core import validators
#from django.core.validators import isValidEmail
from django.utils.translation import gettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django... | en | 0.235892 | # # # #from django.core import validators #from django.core.validators import isValidEmail #addr_code = models.CharField(_('Street Code'), max_length=6) #FIXME: shortname is too short #shortname = models.CharField(_('Region Code'), max_length=6, unique=True, blank=True) #code = models.CharField(_('Town Code'), max_leng... | 1.93815 | 2 |
siliconcompiler/_metadata.py | mfkiwl/siliconcompiler | 0 | 6627640 | # Version number following semver standard.
version = '0.5.0'
# This is the list of significant contributors to SiliconCompiler in
# chronological order.
#
# This does not necessarily list everyone who has contributed code,
# especially since many employees of one corporation may be contributing.
# To see the full lis... | # Version number following semver standard.
version = '0.5.0'
# This is the list of significant contributors to SiliconCompiler in
# chronological order.
#
# This does not necessarily list everyone who has contributed code,
# especially since many employees of one corporation may be contributing.
# To see the full lis... | en | 0.636025 | # Version number following semver standard. # This is the list of significant contributors to SiliconCompiler in # chronological order. # # This does not necessarily list everyone who has contributed code, # especially since many employees of one corporation may be contributing. # To see the full list of contributors, ... | 1.340054 | 1 |
Pwnable/200-FromUserToAdmin/src/authentication.py | Probely/CTF-Challenges | 42 | 6627641 | import time
import struct
import base64
import crypto
import settings
BOX = crypto.Toolbox(settings.EKEY, settings.AKEY)
MAX_USER_LEN = 12
MAX_TOKEN_LEN = 16
USER_PADDING = '\0'
def generate_token(username, ttl=7200):
# A token is a base64-encoded, encrypted, binary structure as follows:
# [padded username ... | import time
import struct
import base64
import crypto
import settings
BOX = crypto.Toolbox(settings.EKEY, settings.AKEY)
MAX_USER_LEN = 12
MAX_TOKEN_LEN = 16
USER_PADDING = '\0'
def generate_token(username, ttl=7200):
# A token is a base64-encoded, encrypted, binary structure as follows:
# [padded username ... | en | 0.285723 | # A token is a base64-encoded, encrypted, binary structure as follows: # [padded username (12 bytes)][time to live (4 byte big-endian integer)] # # Example for username "user": # 'user\x00\x00\x00\x00\x00\x00\x00\x00W\xea\xae\xd9' # Example for username "admin": # 'admin\x00\x00\x00\x00\x00\x00\x00W\xea\xae\xd9' # Trun... | 2.801836 | 3 |
Roku Network Remote.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkRESTfulDevice.py | RogueProeliator/IndigoPlugins-Roku-Network-Remote | 1 | 6627642 | <reponame>RogueProeliator/IndigoPlugins-Roku-Network-Remote<filename>Roku Network Remote.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkRESTfulDevice.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#/////////////////////////////////////////////////////////////////////////////////////////
#////////////////... | Network Remote.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkRESTfulDevice.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
... | en | 0.515262 | #! /usr/bin/env python # -*- coding: utf-8 -*- #///////////////////////////////////////////////////////////////////////////////////////// #///////////////////////////////////////////////////////////////////////////////////////// # RPFrameworkRESTfulDevice by RogueProeliator <<EMAIL>> # This class is a concrete impleme... | 1.517295 | 2 |
app/customfilters.py | razage/TTracker3 | 0 | 6627643 | def statusname(sid):
from app import app
return app.config["STATUSES"][sid]
| def statusname(sid):
from app import app
return app.config["STATUSES"][sid]
| none | 1 | 1.506923 | 2 | |
imap2maildir.py | rtucker/imap2maildir | 55 | 6627644 | <reponame>rtucker/imap2maildir
#!/usr/bin/env python
"""
Mirrors the contents of an IMAP4 mailbox into a local maildir or mbox.
Intended for keeping a local backup of a remote IMAP4 mailbox to protect
against loss. Very handy for backing up "[Gmail]/All Mail" from your
Gmail account, to snag all your archived mail. R... | #!/usr/bin/env python
"""
Mirrors the contents of an IMAP4 mailbox into a local maildir or mbox.
Intended for keeping a local backup of a remote IMAP4 mailbox to protect
against loss. Very handy for backing up "[Gmail]/All Mail" from your
Gmail account, to snag all your archived mail. Re-running it on a regular
basis... | en | 0.730282 | #!/usr/bin/env python Mirrors the contents of an IMAP4 mailbox into a local maildir or mbox. Intended for keeping a local backup of a remote IMAP4 mailbox to protect against loss. Very handy for backing up "[Gmail]/All Mail" from your Gmail account, to snag all your archived mail. Re-running it on a regular basis wil... | 2.625713 | 3 |
api_students/api/urls.py | da-semenov/loft_test | 0 | 6627645 | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_simplejwt.views import (TokenObtainPairView,
TokenRefreshView)
from api.views import StudentViewSet
v1_router = DefaultRouter()
v1_router.register('students', StudentV... | from django.urls import include, path
from rest_framework.routers import DefaultRouter
from rest_framework_simplejwt.views import (TokenObtainPairView,
TokenRefreshView)
from api.views import StudentViewSet
v1_router = DefaultRouter()
v1_router.register('students', StudentV... | none | 1 | 1.96137 | 2 | |
python_modules/dagster/dagster_tests/core_tests/storage_tests/test_local_file_cache.py | dbatten5/dagster | 4,606 | 6627646 | import io
import os
from dagster import LocalFileHandle
from dagster.core.storage.file_cache import FSFileCache
from dagster.utils.temp_file import get_temp_dir
def test_fs_file_cache_write_data():
bytes_object = io.BytesIO(b"bar")
with get_temp_dir() as temp_dir:
file_cache = FSFileCache(temp_dir)
... | import io
import os
from dagster import LocalFileHandle
from dagster.core.storage.file_cache import FSFileCache
from dagster.utils.temp_file import get_temp_dir
def test_fs_file_cache_write_data():
bytes_object = io.BytesIO(b"bar")
with get_temp_dir() as temp_dir:
file_cache = FSFileCache(temp_dir)
... | none | 1 | 2.356035 | 2 | |
database_creator.py | Tasari/Restaurant_system | 0 | 6627647 | <reponame>Tasari/Restaurant_system
import tables.stock
import tables.recipes
import tables.order_product
import tables.order
import tables.products
import tables.worker
from base_template import engine, Base, Session
Base.metadata.create_all(engine)
session = Session()
worker = tables.worker.Worker('Guest', 'guest', '... | import tables.stock
import tables.recipes
import tables.order_product
import tables.order
import tables.products
import tables.worker
from base_template import engine, Base, Session
Base.metadata.create_all(engine)
session = Session()
worker = tables.worker.Worker('Guest', 'guest', 'guest')
worker.promotion(50)
sessio... | zh | 0.15294 | session.query(tables.stock.Stock).\ update({tables.stock.Stock.quantity: 500}) | 1.805089 | 2 |
puppy/data/p/Puppy/Welcome/sample.py | y-akinobu/puppy | 3 | 6627648 | <reponame>y-akinobu/puppy
B = Rectangle(500, 950, width=1000, height=100, isStatic=true)
A = Ball(100,100,strokeStyle="yellow",lineWidth=30,width=100,height=100,fillStyle="green")
print("Hello")
def suzume_collision():
print("Bomb!")
def suzume_clicked():
print("Chun")
suzume = Circle(500,100,image='bird.png'... | B = Rectangle(500, 950, width=1000, height=100, isStatic=true)
A = Ball(100,100,strokeStyle="yellow",lineWidth=30,width=100,height=100,fillStyle="green")
print("Hello")
def suzume_collision():
print("Bomb!")
def suzume_clicked():
print("Chun")
suzume = Circle(500,100,image='bird.png',width=270,clicked=suzume_... | none | 1 | 3.623359 | 4 | |
anthemtool/io/providers/base.py | xyrin88/anthemtool | 14 | 6627649 | <reponame>xyrin88/anthemtool
import abc
class Decompressor(abc.ABC):
"""
Abstract interface for decompressor implementations.
"""
@abc.abstractmethod
def decompress(self, payload: bytes, size: int, output_size: int) -> bytes:
"""
Decompress the given payload.
"""
ra... | import abc
class Decompressor(abc.ABC):
"""
Abstract interface for decompressor implementations.
"""
@abc.abstractmethod
def decompress(self, payload: bytes, size: int, output_size: int) -> bytes:
"""
Decompress the given payload.
"""
raise Exception("Not implemente... | en | 0.662644 | Abstract interface for decompressor implementations. Decompress the given payload. | 3.500427 | 4 |
tests/drum/test_data_marshalling.py | andreakropp/datarobot-user-models | 0 | 6627650 | from datarobot_drum.drum.utils import _order_by_float, _can_be_converted_to_float, marshal_labels
def test_marshal_labels():
assert marshal_labels(expected_labels=["True", "False"], actual_labels=[False, True]) == [
"False",
"True",
]
def test__order_by_float():
assert _order_by_float(["... | from datarobot_drum.drum.utils import _order_by_float, _can_be_converted_to_float, marshal_labels
def test_marshal_labels():
assert marshal_labels(expected_labels=["True", "False"], actual_labels=[False, True]) == [
"False",
"True",
]
def test__order_by_float():
assert _order_by_float(["... | none | 1 | 2.513078 | 3 |