seed
stringlengths
1
14k
source
stringclasses
2 values
''' def formatGram(ngram): return re.sub("[(',)]", '', str(ngram)) ''' Function for Formatting sentences. @Parameters: Sentence: unformatted sentence. @Return: String: formatted sentence. ''' def formatSentence(sentence): sentence = list(sentence) sentence[0] = sentence[0].upper() sentence = ""...
ise-uiuc/Magicoder-OSS-Instruct-75K
from dcstats import * from _version import __version__
ise-uiuc/Magicoder-OSS-Instruct-75K
from budgetme.apps.types.renderers import TransactionCategoryJSONRenderer, BudgetJSONRenderer from budgetme.apps.types.serializers import TransactionCategorySerializer, BudgetSerializer class BudgetViewSet(ModelViewSet): queryset = Budget.objects.select_related('user') permission_classes = (IsAuthenticated,)
ise-uiuc/Magicoder-OSS-Instruct-75K
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution:
ise-uiuc/Magicoder-OSS-Instruct-75K
valence = row[10] popularity = row[11] artist_id[artist_name] = id artists_data.append([id, artist_name, acousticness, danceability, duration, energy, loudness, speechiness, tempo, valence, popularity]) #parse songs and make songs_artists_data simultaneously next(songs_r...
ise-uiuc/Magicoder-OSS-Instruct-75K
import goveed20.LiteraryAssociationApplication.elastic.indexingUnits.BookIndexingUnit; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; public interface BookIndexingUnitRepository extends ElasticsearchRepository<BookIndexingUnit, Long> {
ise-uiuc/Magicoder-OSS-Instruct-75K
print_interactions_selector_form($course);
ise-uiuc/Magicoder-OSS-Instruct-75K
tn.printLS(tn.addTwoNumbers(l1, l2))
ise-uiuc/Magicoder-OSS-Instruct-75K
environment={}): """ Args: commands: A list of commands retry_interval: Time between retries in seconds shell: Choice of shell
ise-uiuc/Magicoder-OSS-Instruct-75K
def setup(app): ucb_page.setup(app)
ise-uiuc/Magicoder-OSS-Instruct-75K
<gh_stars>0 """
ise-uiuc/Magicoder-OSS-Instruct-75K
// Speed // // Created by Chris Dzombak on 5/9/16. // Copyright © 2016 Chris Dzombak. All rights reserved. // import Foundation func formatForCurrentLocale(speedInMetersPerSecond speed: Double) -> String { guard let metricNumber = NSLocale.currentLocale().objectForKey(NSLocaleUsesMetricSystem) as? NSNumber els...
ise-uiuc/Magicoder-OSS-Instruct-75K
ConfirmAssetUploadReq::ConfirmAssetUploadReq() {
ise-uiuc/Magicoder-OSS-Instruct-75K
class ApiKey(BaseModel): key: str
ise-uiuc/Magicoder-OSS-Instruct-75K
//解决办法有两个:1、intentservice 2、远程服务 process remote 3、疑问:OkHttpUtils下载文件应该在子线程中执行 //2、自动更新 } @Override //正在下载 public void inProgress(float progress, long total, int id) { super.inProgress...
ise-uiuc/Magicoder-OSS-Instruct-75K
}, "meet": { 'name': 'Google Meet', 'keycode': (platform_key, Keycode.D), 'color': (12, 132, 0) }, "slack": { 'name': 'Slack', 'keycode': (Keycode.M), 'color': (200, 80, 0) }, "jitsi": { 'name': 'Jitsi', 'keycode': (Keycode.M), ...
ise-uiuc/Magicoder-OSS-Instruct-75K
active_constraint_values = [] active_constraint_variables = []
ise-uiuc/Magicoder-OSS-Instruct-75K
public void test (){ StateOfTheGame state = new StateOfTheGame (); Gametaker caretaker = new Gametaker(); Originator originator = new Originator(); originator.setState(state); originator.setState(state); caretaker.addRedoMemento( originator.save() ); originator.setState(state); caretake...
ise-uiuc/Magicoder-OSS-Instruct-75K
}) } @IBAction func share(_ sender: Any) { guard let image = image else { return } let activityViewController = UIActivityViewController(activityItems: [image], applicationActivities: nil) activityViewController.popoverPresentationController?.sourceView = shareButton activityViewController.popoverPresenta...
ise-uiuc/Magicoder-OSS-Instruct-75K
self.assertIn('success', data['status']) self.assertEqual(str(organization.uuid), data['data']['organization']['uuid']) def test_single_organization_users(self): """Ensure getting users for an organization behaves correctly.""" user = add_user('new_user RQNUIAN', '<EMAIL>', ...
ise-uiuc/Magicoder-OSS-Instruct-75K
void set_aggregator(AggregatorT* ag, FinalT init_value); void run(const WorkerParams& params); };
ise-uiuc/Magicoder-OSS-Instruct-75K
import { fallen } from './../shared/material-module/material.module'; @Component({ selector: 'app-open-last', templateUrl: './open-last.component.html', styleUrls: ['./open-last.component.scss'] }) export class OpenLastComponent implements OnInit { logged = false; fallen:boolean; constructor(private router...
ise-uiuc/Magicoder-OSS-Instruct-75K
# limitations under the License. from multiprocessing import Manager from typing import TYPE_CHECKING, Any from tethys.core.nodes.operators.operator_base import OperatorBase from tethys.utils.iterable import flat_iter _node_pipes = {} _cursors = Manager().dict() if TYPE_CHECKING:
ise-uiuc/Magicoder-OSS-Instruct-75K
class DoublylinkedListNode: def __init__(self, key, value): self.key = key self.value = value self.prev = None self.next = None self.time_created = time() def remove_bindings(self):
ise-uiuc/Magicoder-OSS-Instruct-75K
Provides file size information when dealing with torrents """ @priority(200) def on_task_modify(self, task): for entry in task.entries: if 'torrent' in entry: size = entry['torrent'].size / 1024 / 1024 log.debug('%s size: %s MB' % (entry['title'], siz...
ise-uiuc/Magicoder-OSS-Instruct-75K
STATUS=`echo "display chstatus('$2') status"| runmqsc $1|grep STATUS |awk -F\( '{print $2}'|awk -F\) '{print $1}'` case $STATUS in RUNNING) echo 1 ;; RETRYING) echo 2 ;;
ise-uiuc/Magicoder-OSS-Instruct-75K
self.item_list = None self.discovered_answer = None self.description = None self.answer_dict = None self.measure_p_at_k = None self.measure_ap = None
ise-uiuc/Magicoder-OSS-Instruct-75K
tape.pop(); if(tape.empty()) break; } tape.push(arr[i]);
ise-uiuc/Magicoder-OSS-Instruct-75K
admin.site.register(Source) admin.site.register(BulkPayment, BulkPaymentModelAdmin) admin.site.register(Pledge, PledgeModelAdmin) admin.site.register(Contribution, ContributionModelAdmin)
ise-uiuc/Magicoder-OSS-Instruct-75K
$lister->current_row->set('iso', mb_strtolower($lister->current_row->get('iso'))); });
ise-uiuc/Magicoder-OSS-Instruct-75K
import pandas as pd # 读取气象数据 tmp = pd.read_csv( u'47891_高松.csv', parse_dates={'date_hour': ["日期"]}, index_col = "date_hour",
ise-uiuc/Magicoder-OSS-Instruct-75K
""" )
ise-uiuc/Magicoder-OSS-Instruct-75K
from xue.common.decorators import quickview from springaid2012.models import ApplicationEntry from springaid2012.forms import ApplicationForm @quickview('springaid2012/application.html') def application_view(request): if request.method == 'POST': # form data
ise-uiuc/Magicoder-OSS-Instruct-75K
sample 13288 kb submission class Solution: rst = [] def partition(self, s: str) -> List[List[str]]: self.rst = [] n = len(s) out = [] dp = [[False for _ in range(n)] for _ in range(n)] for i in range(n): for j in range(0, i + 1): if s[...
ise-uiuc/Magicoder-OSS-Instruct-75K
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
ise-uiuc/Magicoder-OSS-Instruct-75K
@Override public void delete(PageId pageId) throws IOException, PageNotFoundException { PageId pageKey = getKeyFromPageId(pageId); if (!mPageStoreMap.containsKey(pageKey)) { throw new PageNotFoundException(pageId.getFileId() + "_" + pageId.getPageIndex()); } mPageStoreMap.remove(pageKey); ...
ise-uiuc/Magicoder-OSS-Instruct-75K
@patch( 'elasticsearch_dsl.Document.save' ) def test_relative_count_should_be_correct( self, document_save, ): count = self.catalog.count + 10 pulse = self.catalog.update_count( count ) self.assertEqual( pulse.relative_count, 10 ) class Test_catalog_build_pulse( unittest.Te...
ise-uiuc/Magicoder-OSS-Instruct-75K
homeTweetsViewController = homeTweetsNC.topViewController as! TweetsViewController homeTweetsViewController.channel = .HOME let mentionsTweetsNC = storyboard.instantiateViewController(withIdentifier: "TweetsNavigationController") as! UINavigationController mentionsTweetsViewCont...
ise-uiuc/Magicoder-OSS-Instruct-75K
public static List<LiteAppContextInitProvider> getLiteAppContextInitProvider(){ return providerList; } }
ise-uiuc/Magicoder-OSS-Instruct-75K
exit 1 } error_handler() { error_message "不明なエラー" } error_message() { printf '\e[31m%s: エラー: %s\e[m\n' "${cmdname}" "${1}" 1>&2 printf '\e[31m%s: 終了します\e[m\n' "${cmdname}" 1>&2
ise-uiuc/Magicoder-OSS-Instruct-75K
from bottle import get, post
ise-uiuc/Magicoder-OSS-Instruct-75K
plt.gca().add_collection(pc_blue) plt.gca().add_collection(pc_red) plt.title(title) plt.xlim(times[0], times[-1]) return plt.gca()
ise-uiuc/Magicoder-OSS-Instruct-75K
#define SHERLOCK_DEALLOCATOR_HPP_INCLUDED // Include 3rd party headers. #include <opencv2/opencv.hpp>
ise-uiuc/Magicoder-OSS-Instruct-75K
# Links: # - https://github.com/Versent/saml2aws # Set the location of the saml2aws configuration file. export SAML2AWS_CONFIGFILE="${XDG_CONFIG_HOME}/saml2aws/config"
ise-uiuc/Magicoder-OSS-Instruct-75K
func_array=(sigmoid tanh soft_plus snormal_dis scauchy_dis gamma_dis sexp_dis chi_square slog_dis reciprocal func_sqrt func_log func_exp); rm -r ${logFolder}*; for func in ${func_array[*]} do logFile=${logFolder}compile_${func}; blogFile=${blogFolder}compile_${func}; ./compile.py -R 256 $...
ise-uiuc/Magicoder-OSS-Instruct-75K
print(cubic_to_constants(C)) print()
ise-uiuc/Magicoder-OSS-Instruct-75K
def _is_goal_complete(self, model_output, _): return ( self.target_class == model_output.argmax() ) or self.ground_truth_output == self.target_class
ise-uiuc/Magicoder-OSS-Instruct-75K
pub use adapter::Adapter;
ise-uiuc/Magicoder-OSS-Instruct-75K
retstr += req.url.path if req.url.params: retstr += '?' params = req.url.params.split("&") pairs = [tuple(param.split("=")) for param in params] paramstrs = [] for k, v in pairs: if colored: paramstrs += (Colors.GREEN + '{}' + Colors.EN...
ise-uiuc/Magicoder-OSS-Instruct-75K
{ Name = "Rule #1", Condition = NonEmptyReference, Value = 1 }; var taxRegistryBuilder = new TaxRegistryBuilder<FooDocument>(); taxRegistryBuilder.RegisterRule(taxRule); var taxRegistry = taxRegistryBuilder.Build();
ise-uiuc/Magicoder-OSS-Instruct-75K
var user = WebApiHelper.GetUser(Request, _config); if (user == null) return false; if (forSteamId != null && user.SteamId?.Equals(forSteamId, StringComparison.OrdinalIgnoreCase) == true) user.Roles = user.Roles.Concat(new[] { "self" }).Distinct().OrderBy(x => x).ToArray(); ...
ise-uiuc/Magicoder-OSS-Instruct-75K
def index(self): return self.render('/admin/index.html') class myModelView(AccessMixIn, ModelView): can_delete = False form_base_class = SecureForm column_display_pk = True
ise-uiuc/Magicoder-OSS-Instruct-75K
#==============================# #==============================# # Platform Import # #==============================# import torch.nn as nn #==============================# # Class/Layer Part Import # #==============================# from .AStar import AStar
ise-uiuc/Magicoder-OSS-Instruct-75K
else: minVal = min(helper(i+1,r), minVal) memo[s[l:r+1]] = minVal + 1 return memo[s[l:r+1]] helper(0,len(s)-1) return memo[s]-1 if memo[s] != float('inf') else 0
ise-uiuc/Magicoder-OSS-Instruct-75K
Column in the metadata for the cells, cell types or samples in the matrix containing CCI scores. group_col : str, default='Groups' Column in the metadata containing the major groups of cells, cell types
ise-uiuc/Magicoder-OSS-Instruct-75K
pub(msg::RequestShutdown{});
ise-uiuc/Magicoder-OSS-Instruct-75K
class Prim { private: // Priority Queue (PQ) to be used in Prim's algorithm // vertex 1 // connected_vertex // weight std::map<int, std::vector<std::map<int, int>>> priority_queue; void add_edge_priority_queue(int vertex1, int vertex2, int weight); int mst_add_lowest...
ise-uiuc/Magicoder-OSS-Instruct-75K
} #endif CreateDXGIFactory1(IID_PPV_ARGS(&m_DXGIFactory)); // Try to create hardware device. HRESULT hardwareResult = D3D12CreateDevice( nullptr, // default adapter
ise-uiuc/Magicoder-OSS-Instruct-75K
public class Controller { @Inject
ise-uiuc/Magicoder-OSS-Instruct-75K
output = self._command(cpu_show_cmd)['output'] lines = output.split('\n'); cpu_util = -1.0 # search for the line
ise-uiuc/Magicoder-OSS-Instruct-75K
export default class BrowserLocalStorage implements SessionStorage { private readonly _tokenKey: string;
ise-uiuc/Magicoder-OSS-Instruct-75K
... becomes import functools autoload_node = functools.partial(autoload, Node, 'node_id', 'node') @autoload_node def get_node(node): ... """
ise-uiuc/Magicoder-OSS-Instruct-75K
totalCities: number; cities: Array<ICity>; }
ise-uiuc/Magicoder-OSS-Instruct-75K
SS_LDBG << implName << "Initialized"; } catch (CException& ex) { SS_LAPP << "Error initializing " << implName; throw ex; } return result; } /*! */
ise-uiuc/Magicoder-OSS-Instruct-75K
} return results.results .filter((r: any) => !isNil(r.poster_path) && r.vote_average > 0) .slice(0, 10) .map((result: any) => { return { moviePosterUrl: `${getImageUrl( ImageType.W92, result.poster_path )}`,
ise-uiuc/Magicoder-OSS-Instruct-75K
from core.user.views import *
ise-uiuc/Magicoder-OSS-Instruct-75K
""" Calculate beta and gamma based on velocity. Args: velocity: Particle velocity in m/s. Returns: (beta, gamma) """ beta = velocity / c return beta, 1. / np.sqrt(1 - beta**2) @staticmethod
ise-uiuc/Magicoder-OSS-Instruct-75K
using System.Collections.Generic; using NUnit.Framework; namespace Unity.Properties.Tests { partial class PropertyContainerTests { [Test] public void SetValue_AssigningAPropertyOfTheSameType_ValueShouldBeSet() { var container = new StructWithPrimitives();
ise-uiuc/Magicoder-OSS-Instruct-75K
use mindplay\annotations\Annotation; /** * @usage('method' => true) **/ class ActAnnotation extends Annotation {
ise-uiuc/Magicoder-OSS-Instruct-75K
if [ -z "$dotnet" ] then echo Parameter 3 must be set and is the dotnet environment name ex: hgpoc, hgdev, hgtest, Production fi oc process -f ./service.yaml -p NAME=webclient -p APP_NAME=webclient -p TOOLS_NAMESPACE=$namespace-tools -p ENV=$env -p ASPNETCORE_ENVIRONMENT=$dotnet | oc apply -f - oc process -f ./serv...
ise-uiuc/Magicoder-OSS-Instruct-75K
function test_it_gets_all_my_notes() { $this->restartContainer(); $me = new Identity(); $this->setAuthenticatedUser($me);
ise-uiuc/Magicoder-OSS-Instruct-75K
self.horizontalHeader().setDefaultAlignment(Qt.AlignLeft) self.verticalHeader().setSectionResizeMode(QHeaderView.Fixed) self.verticalHeader().setDefaultSectionSize(47) self.horizontalHeader().setMinimumHeight(30) # 表头高度 # 设置让表示歌曲名的一列自动延伸 self.horizontalHeader().setSect...
ise-uiuc/Magicoder-OSS-Instruct-75K
fn median(list: &Vec<i32>) -> f32 { let mut temp = list.clone(); temp.sort(); if list.len() % 2 == 0 { let i = list.len() / 2; let n = temp[i] as f32; let d = temp[i - 1] as f32; (n + d) / 2.0 } else {
ise-uiuc/Magicoder-OSS-Instruct-75K
<gh_stars>0 N = int(input()) A = [int(n) for n in input().split()] ans = [0] + [0]*N for i in range(N-1): ans[A[i]] += 1 for i in range(1, N+1): print(ans[i])
ise-uiuc/Magicoder-OSS-Instruct-75K
dewarped = cv2.imread('../dewarped.png')
ise-uiuc/Magicoder-OSS-Instruct-75K
# TODO this needs more testing but it works so far def op_setup(self): """ """ self.ops = [[] for i in range(self.nmodes)] if 'modes' in self.term: # check that it's not purely electronic
ise-uiuc/Magicoder-OSS-Instruct-75K
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service;
ise-uiuc/Magicoder-OSS-Instruct-75K
lookup_expr='icontains',
ise-uiuc/Magicoder-OSS-Instruct-75K
"ldap_id": {"type": int, "default": -1}, "org_id": {"type": int, "default": -1}, "host": {"type": str, "default": ''}, "port": {"type": int, "default": 636}, "use_sll": {"type": bool...
ise-uiuc/Magicoder-OSS-Instruct-75K
export PATH=/usr/local/miniconda2/bin:$PATH echo "===== Testing theano core" # Test theano core PARTS="theano -e cuda -e gpuarray" THEANO_PARAM="${PARTS} --with-timer --timer-top-n 10 --with-xunit --xunit-file=theanocore_tests.xml" FLAGS="mode=FAST_RUN,floatX=float32,on_opt_error=raise,on_shape_error=raise,cmodule.ag...
ise-uiuc/Magicoder-OSS-Instruct-75K
else: self.progress_bar.update()
ise-uiuc/Magicoder-OSS-Instruct-75K
# -------------------------------------------------------------------------- def repos_backstage(self): return self._repos_backstage # -------------------------------------------------------------------------- def find_item(self, split_path): if not split_path or split_path == ["."]: ...
ise-uiuc/Magicoder-OSS-Instruct-75K
from .core import locations from .core.base import PRAC
ise-uiuc/Magicoder-OSS-Instruct-75K
//$this->add_newmsgnum($login_uid);
ise-uiuc/Magicoder-OSS-Instruct-75K
return bid
ise-uiuc/Magicoder-OSS-Instruct-75K
import socket from pprint import pprint import asn1tools
ise-uiuc/Magicoder-OSS-Instruct-75K
// MARK: - Properties private let line1 = UILabel().then { $0.text = StringManager.notExchangeAndReturn.line.rawValue } private let line2 = UILabel().then { $0.text = StringManager.notExchangeAndReturn.line1.rawValue } private let line3 = UILabel().then { $0.text = Str...
ise-uiuc/Magicoder-OSS-Instruct-75K
} public List<Map<String, Object>> getData() { mDataList = new ArrayList<Map<String, Object>>(); for(int i=0;i<icon.length;i++){
ise-uiuc/Magicoder-OSS-Instruct-75K
keyboards: ['en', 'numbers', 'punct_en', 'specials'], keys: [], };
ise-uiuc/Magicoder-OSS-Instruct-75K
var gameObjects = PlayingGameObjectsByClipName[clipName]; if (gameObjects.Contains(maHolderGameObject)) { return; // already added before somehow } gameObjects.Add(maHolderGameObject); }
ise-uiuc/Magicoder-OSS-Instruct-75K
def prerun(self): self.conf.fs.hit = 1 conf_alt_fs = { 'fs1': { 'dmg': 207 / 100.0, 'sp': 600, 'charge': 24 / 60.0, 'startup': 20 / 60.0, 'recovery': 20 / 60.0, }, 'fs2': { ...
ise-uiuc/Magicoder-OSS-Instruct-75K
public PrintVisitor(int indent, PrintStream out) { this(indent, ' ', out); }
ise-uiuc/Magicoder-OSS-Instruct-75K
for a given diameter, return the max RPM to stay within 0.7 mach tip speed """ return (0.7 * speed_of_sound(1.4,101325,1.225) * 60)/(math.pi * diameter)
ise-uiuc/Magicoder-OSS-Instruct-75K
override func layoutSubviews() { super.layoutSubviews() imageView.frame = CGRect(x: 5, y: 15, width: width - 10, height: height - 40) titleLabel.frame = CGRect(x: 5, y: height - 20, width: imageView.width, height: 10) } fileprivate func setUI() { imageView = UIImageView()...
ise-uiuc/Magicoder-OSS-Instruct-75K
JOB,LDWORK,N $TEMPLATE[trsna.all.min_size_work] return job == 'E' ? 1 : ldwork * (n+6); $TEMPLATE[trsna.real.min_size_iwork.args] JOB,N $TEMPLATE[trsna.real.min_size_iwork] return std::max< $INTEGER_TYPE >( 1, job == 'E' ? 1 : 2 * (n-1)); $TEMPLATE[trsna.complex.min_size_rwork.args] JOB,N $TEMPLATE[trsna.complex.min_si...
ise-uiuc/Magicoder-OSS-Instruct-75K
file_size_dl += len(buffer)
ise-uiuc/Magicoder-OSS-Instruct-75K
else: n = len(Input)-len(Keyword) Keyword += Key[0:n] if len(Keyword)==len(Input): break '''Deciphering the Ciphertext using the Keyword and TempLists The AlphaList and TempLists are reversed,i.e.,A will be Z, B will be Y and so on, This is the main difference between Vigen...
ise-uiuc/Magicoder-OSS-Instruct-75K
def create_particle_file_name(folder_path: str, img_number: int, coord_indx: int, ext: str) -> str: file_name = str(img_number) + 'particle' + str(coord_indx) + '.' + ext return join(folder_path, file_name)
ise-uiuc/Magicoder-OSS-Instruct-75K
sep='' for j in a b c ; do # 3 variants of each kind, corresponding to the 3 genes mol=$i$j clm=`grep -n $mol ${PREF}-head.txt | cut -f 1 -d ':'` #echo "$i$j = $clm" cmd="$cmd$sep \"${PREF}.gr\" using 1:$clm w l lw 2 title \"$mol\"" sep=',' done #echo "cmd=$cmd"
ise-uiuc/Magicoder-OSS-Instruct-75K
return None wb = load_workbook(filename) sheets = Opt() names = [] for sheetname in wb.sheetnames: if sheetname in title_sheet_map:
ise-uiuc/Magicoder-OSS-Instruct-75K